Skip to content

fix(release): start release.yml on the release tag, since a draft release starts no workflow - #190

Merged
aRustyDev merged 1 commit into
mainfrom
fix/release-trigger
Nov 16, 2026
Merged

aRustyDev merged 1 commit into
mainfrom
fix/release-trigger

Conversation

@aRustyDev

Copy link
Copy Markdown
Owner

What went wrong

The first release, #187 (v0.1.0):

  • Worked:
    • release-plz's release job tagged the merge commit v0.1.0, through the tag ruleset. The App needed no Administration permission.
    • It created the draft release.
  • Didn't work: release.yml never ran.

The fix

  • release-plz.yml: after release-plz tags and creates the draft, the release job runs gh workflow run release.yml --ref <tag>.
    • The tag comes from release-plz's own releases output. It lists each crate, all under the one workspace tag. The step fails unless there is exactly one tag.
    • A workflow_dispatch made with the workflow's own token does start a run. It is the documented exception to "GITHUB_TOKEN starts no workflow".
    • The run's ref is the tag, so the attestations and verify-bundle.sh are unchanged.
    • The job gains actions: write.
  • release.yml: runs on workflow_dispatch, plus the pull-request dry run as before.
    • If the dispatch ever doesn't happen, a person starts it the same way: gh workflow run release.yml --ref vX.Y.Z.
    • The plan moved out of YAML into plan-release.sh. A dispatch releases only when it is on a v<version> tag that points at the run's commit, and that commit is on main. Any other dispatch is refused.
    • Whether the release is still a draft is checked in publish, as before. Its contents: write token can see drafts.
  • Docs:
    • cicd.md and release.md: the trigger, and a "never started" row in the failure table.
    • ADR-0110's update: the Administration question is settled by the first release.
    • PLAN.md.

Tests

  • test-plan-release.sh (new): every combination of the inputs, 1,810 checks.
    • 6 events.
    • 12 refs: annotated and lightweight tags on main, a tag off main, v1/x, v, a non-release tag, a missing tag, and a branch named like a tag.
    • 6 commits: right, wrong, off main, not hex, short hex, empty.
  • Hand mutants: 12 of 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.
  • Locally: every ci-scripts test and deps guard under dash (36 of 36), lint-workflow.sh on all three release files, check-release-plz.py and actionlint.

Not verified until it runs

The dispatch step itself runs only when release-plz releases. v0.1.0's own tag commit has the old release.yml, which has no workflow_dispatch, so v0.1.0 cannot be dispatched as it stands. What to do with it is a separate decision, outside this PR.

Refs: #49

🤖 Generated with Claude Code

…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]>
@aRustyDev
aRustyDev merged commit 8f7e490 into main Nov 16, 2026
39 checks passed
@aRustyDev
aRustyDev deleted the fix/release-trigger branch November 16, 2026 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant