A publish job that cannot succeed is not a gate, it is noise - #94
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The defect
Every
v*tag triggersrelease.yml, whose publish job attempts PyPI Trusted Publishing. That OIDC exchange has never been configured on the PyPI side, so the job fails closed on every tagged release — v0.1.3 and v0.1.4 both wear a red X while the releases themselves went out by hand via twine, successfully. A job that is known in advance to fail teaches people to ignore red, which is the one thing a CI signal must never do.The fix
The publish job is now additionally gated on a repository variable:
Until the variable exists, a tag still runs the full build-and-verify job (tag-matches-version check, twine metadata check, wheel-installs-and-imports-everything check, sdist leak check) and the run finishes green with publish skipped — the gate keeps gating, the noise stops.
When the one-time PyPI configuration is done (this repo, this workflow filename, the
pypienvironment), flipPYPI_TRUSTED_PUBLISHINGtotrueunder Settings → Secrets and variables → Actions → Variables, and tags publish themselves. Fail-closed is preserved in the wrong-order case: flipping the variable without the PyPI-side setup still fails on the OIDC exchange rather than uploading anything.The workflow header and the job comment both document the variable and the flip, so the next person reading a skipped publish job knows exactly why it skipped and what makes it run.
No behavior change for
workflow_dispatchdry runs. YAML validated; packaging tests green.🤖 Generated with Claude Code