Repository navigation
fix(release): start release.yml on the release tag, since a draft release starts no workflow - #190
Merged
Merged
Conversation
…ease starts no workflow The first release (#187, v0.1.0) made the tag and the draft, but release.yml never ran: it listened for `release: created`, and GitHub runs no workflow for the created, edited or deleted events of a draft release (its documentation of the `release` event). - release-plz.yml: the `release` job dispatches release.yml on the tag release-plz reports in its `releases` output (one tag, or it fails), with `actions: write` on the workflow token. A workflow_dispatch made with GITHUB_TOKEN is the documented exception that does start a run, and the run's ref is the tag, which the attestations record and verify-bundle.sh requires. - release.yml: runs on workflow_dispatch (and a pull request's dry run); a person can start it the same way when the dispatch never happened. Its plan is now .github/scripts/plan-release.sh: a dispatch on a v<version> tag that points at the run's commit, on main, releases; any other dispatch is refused. The draft check stays in `publish`, whose token can see drafts. - Docs: cicd.md and release.md (the trigger, a "never started" row), ADR-0110's update (the App needed no Administration permission for the tag), PLAN.md. Tests: test-plan-release.sh, every combination of event, ref and commit (1810 checks); 12 hand mutants of plan-release.sh, each caught. Refs: #49 Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
What went wrong
The first release, #187 (
v0.1.0):releasejob tagged the merge commitv0.1.0, through the tag ruleset. The App needed no Administration permission.release.ymlnever ran.release: created, but GitHub runs no workflow for thecreated,editedordeletedevents of a draft release. That's in GitHub's documentation of thereleaseevent, and I missed it.The fix
release-plz.yml: after release-plz tags and creates the draft, thereleasejob runsgh workflow run release.yml --ref <tag>.releasesoutput. It lists each crate, all under the one workspace tag. The step fails unless there is exactly one tag.workflow_dispatchmade with the workflow's own token does start a run. It is the documented exception to "GITHUB_TOKENstarts no workflow".verify-bundle.share unchanged.actions: write.release.yml: runs onworkflow_dispatch, plus the pull-request dry run as before.gh workflow run release.yml --ref vX.Y.Z.plan-release.sh. A dispatch releases only when it is on av<version>tag that points at the run's commit, and that commit is onmain. Any other dispatch is refused.publish, as before. Itscontents: writetoken can see drafts.cicd.mdandrelease.md: the trigger, and a "never started" row in the failure table.PLAN.md.Tests
test-plan-release.sh(new): every combination of the inputs, 1,810 checks.main, a tag offmain,v1/x,v, a non-release tag, a missing tag, and a branch named like a tag.main, not hex, short hex, empty.plan-release.sh, all caught. The first run left 2 alive: a branch named like a tag, and a sha that is hex but short. Both cases are now in the matrix.ci-scriptstest anddepsguard under dash (36 of 36),lint-workflow.shon all three release files,check-release-plz.pyandactionlint.Not verified until it runs
The dispatch step itself runs only when release-plz releases.
v0.1.0's own tag commit has the oldrelease.yml, which has noworkflow_dispatch, sov0.1.0cannot be dispatched as it stands. What to do with it is a separate decision, outside this PR.Refs: #49
🤖 Generated with Claude Code