Skip to content

Commit ef407cb

Browse files
author
Guillaume Lessard
committed
fix(release): publish job was eligible on a publish=false dispatch
Near miss, and the worst class of bug in this pipeline. The gate read `|| inputs.publish`. A workflow_dispatch input arrives as a string, and every non-empty string is truthy in a GitHub expression, so `-f publish=false` evaluated TRUE and the publish job was live on runs that explicitly asked not to publish. Only the wheel builds failing kept 0.7.0 off PyPI - the dry runs were not dry. It surfaced because the job reported `cancelled` rather than `skipped` when the run was cancelled. That distinction is the tell: GitHub reports `skipped` for a job its `if` rejected, and `cancelled` for one that was live and waiting on `needs`. Verified: conclusion=cancelled on run 30683646801. Compare against the literal string `'true'` instead. PyPI refuses re-uploads of a version, so an accidental publish cannot be undone - this gate has to be exact rather than approximately right.
1 parent 2b71376 commit ef407cb

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

.github/workflows/release-build.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,10 +390,20 @@ jobs:
390390
needs: [build, sdist, dependency-gate]
391391
runs-on: ubuntu-latest
392392
# Tag push and GitHub Release both publish; manual dispatch only when asked.
393+
# `inputs.publish` alone is NOT safe here. A workflow_dispatch input arrives
394+
# as a string, and every non-empty string is truthy in a GitHub expression -
395+
# so `publish=false` evaluated TRUE and this job was eligible on a run that
396+
# was explicitly asked not to publish. It showed as `cancelled` rather than
397+
# `skipped`, which is how it was caught; a skipped job is one the `if`
398+
# rejected, a cancelled one was live and waiting on `needs`. Only the wheel
399+
# builds failing kept 0.7.0 off PyPI.
400+
#
401+
# Compare against the literal string instead. PyPI refuses re-uploads of a
402+
# version, so an accidental publish is not recoverable.
393403
if: >-
394404
startsWith(github.ref, 'refs/tags/v')
395405
|| github.event_name == 'release'
396-
|| inputs.publish
406+
|| github.event.inputs.publish == 'true'
397407
environment:
398408
name: pypi
399409
url: https://pypi.org/p/qector-decoder-v3

0 commit comments

Comments
 (0)