Fix release automation: explicitly dispatch release.yml instead of relying on the tag push#51
Merged
Merged
Conversation
…he tag push auto-tag-release.yml (added in 0.1.0.dev4, #50) pushed the release tag using the workflow's own default GITHUB_TOKEN and assumed that push would trigger release.yml's push.tags listener, the way a manual git tag && git push would. It does not: GitHub suppresses push-triggered workflow runs caused by a GITHUB_TOKEN-authored push, specifically to prevent workflows from recursively triggering each other. Confirmed on the actual merge of #50: auto-tag-release.yml ran successfully and pushed v0.1.0.dev4, but no release.yml run was ever created for that tag, no GitHub Release exists for it, and PyPI stayed at 0.1.0.dev2. auto-tag-release.yml now explicitly dispatches release.yml via `gh workflow run` after pushing the tag (workflow_dispatch is the documented exception to the push-suppression above), passing the tag as both the dispatch ref and the ref input, plus a new create_github_release input. The job gains an actions:write permission to make that dispatch call. release.yml gains the create_github_release workflow_dispatch input (default false, preserving the existing "republish an already-released tag to PyPI only" behavior for a plain manual dispatch) and: - sign-and-release now runs on a real tag push OR create_github_release == 'true', instead of only on a tag push - the release step sets tag_name explicitly rather than relying on ref inference, so it is correct for both a tag push and a workflow_dispatch run - the PyPI publish step sets skip-existing: true, so a re-dispatch or an out-of-band manual republish of an already-published version does not fail the job release.yml's push.tags trigger and its existing workflow_dispatch "ref"-only republish path are otherwise unchanged: a human pushing a tag with their own credentials is not subject to the GITHUB_TOKEN suppression, so that path continues to work exactly as before. CHANGELOG.md and CONTRIBUTING.md are corrected to state the real trigger mechanism instead of the false "the tag push triggers release.yml" claim. Verified: both workflow files parse as valid YAML with the expected jobs and workflow_dispatch inputs; the embedded shell script's syntax checked with bash -n; the full local gate (pytest at 100% coverage, ruff, black, mypy --strict, bandit, pre-commit) is unaffected, since none of this touches groupoid/ or tests/. Recovery for the still-unreleased v0.1.0.dev4: once this is merged, release.yml can be dispatched directly against the existing tag with ref=v0.1.0.dev4 and create_github_release=true, publishing the version that has been sitting tagged but unreleased since #50 merged -- without deleting or recreating that tag.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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 bug, confirmed on the actual #50 merge
auto-tag-release.ymlpushed the release tag using the workflow's own defaultGITHUB_TOKENand assumed that push would triggerrelease.yml'spush.tagslistener, the way a manualgit tag && git pushwould. It does not: GitHub suppresses push-triggered workflow runs caused by aGITHUB_TOKEN-authored push, specifically to prevent workflows from recursively triggering each other.Confirmed directly:
auto-tag-release.ymlran successfully on the #50 merge and pushedv0.1.0.dev4, but norelease.ymlrun was ever created for that tag, no GitHub Release exists for it (404), and PyPI is still at0.1.0.dev2. My mistake — I used this exact GitHub behavior to argue the two-workflow split was safe from double-firing, without working through that it also means the second workflow never fires at all.The fix
auto-tag-release.yml: after pushing the tag, explicitly dispatchesrelease.ymlviagh workflow run(workflow_dispatchis the documented exception to the push-suppression above), passing the tag as both the dispatch ref and therefinput, plus a newcreate_github_release: true. Gains anactions: writepermission to make that call.release.yml: gains acreate_github_releaseworkflow_dispatch input (defaultfalse, preserving the existing "republish an already-released tag to PyPI only" behavior for a plain manual dispatch).sign-and-releasenow runs on a real tag push orcreate_github_release == 'true', instead of only on a tag push.tag_nameexplicitly rather than relying on ref inference, so it's correct for both trigger types.skip-existing: true, so a re-dispatch or an out-of-band manual republish of an already-published version doesn't fail the job.push.tagsand the existingref-only manual-republish path are otherwise unchanged — a human pushing a tag with their own credentials isn't subject to theGITHUB_TOKENsuppression, so that path still works exactly as before.CHANGELOG.md/CONTRIBUTING.md: corrected to state the real trigger mechanism instead of the false "the tag push triggersrelease.yml" claim.Verification
workflow_dispatchinputs.bash -n.groupoid/ortests/.Recovery for the still-unreleased
v0.1.0.dev4Once this merges,
release.ymlcan be dispatched directly against the existing tag withref=v0.1.0.dev4andcreate_github_release=true, publishing the version that's been sitting tagged but unreleased since #50 merged — without deleting or recreating that tag. I can run that dispatch once this PR is merged, if you'd like.