feat(release): add pr-release.yml, the release PR and what it has to start - #106
Merged
Merged
Conversation
…start
Nothing GITHUB_TOKEN creates starts a workflow: a release PR opened with
it gets a pull_request run that never has a job, and nothing listening
for `release: published` runs. So every release-please caller starts its
CI on the release PR, and its follow-ons at a cut tag, by
workflow_dispatch. This repository did that in self-release.yml; the
template did it again in cd-release.yml, as four inline steps with the
same fromJSON('') workaround.
pr-release.yml is that job, once: release-please (as the RELEASE_TAGGER
App when its optional secrets are set), the root release PR's number and
branch as outputs, `ci-workflow` started on every release PR the push
touched, and `dispatch-on-release` - one `workflow.yml key=value` per
line, `{tag}` filled in - started at the new tag. Every shell step is a
script with its own bats file: dispatch-release-pr-ci.sh moves from
scripts/self to scripts/release and takes the workflow's name, and
release-pr-read.sh, dispatch-at-tag.sh and release-summary.sh are new.
self-release.yml now calls it from the same commit, with ci-workflow
self-ci.yml, and gates the dev-config publish on paths-released.
grimen
force-pushed
the
feat/release-pr-workflow
branch
from
September 28, 2026 10:12
89dbdd0 to
831c9df
Compare
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 and why
Nothing
GITHUB_TOKENcreates starts a workflow. A release PR opened with it gets apull_requestrun that never has a job, and nothing listening forrelease: publishedruns. So every release-please caller starts its CI on the release PR, and its follow-on workflows at a cut tag, byworkflow_dispatch.This repository does that in
self-release.yml. The template does it again incd-release.yml, as four inline steps with the samefromJSON('')workaround, and its copy has already diverged: no App token, and it readsprrather thanprs..github/workflows/pr-release.yml(new) does it once. ItsReleasejob:RELEASE_TAGGER_APP_IDandRELEASE_TAGGER_APP_PRIVATE_KEYare both set (optional;RELEASE_PLEASE_TOKEN, thengithub.token, otherwise);config-file,manifest-file);paths released: …to the job summary;pr-numberandpr-branch;ci-workflow(defaultci.yml, empty for none) on every release PR the push touched;dispatch-on-releaseline (workflow.yml key=value …,{tag}filled in,#and blank lines skipped) at the new tag.Outputs:
release-created,tag-name,paths-released,pr-number,pr-branch. Every shell step is a script with its own bats file:scripts/release/dispatch-release-pr-ci.sh: moved fromscripts/self/, now takesCI_WORKFLOWinstead of namingself-ci.yml.scripts/release/release-pr-read.sh(new): an empty, non-object or incompleteproutput is fatal.scripts/release/dispatch-at-tag.sh(new): validates every line before starting anything, then tries every dispatch and fails if any failed.scripts/release/release-summary.sh(new).self-release.ymlnow calls./.github/workflows/pr-release.ymlfrom the same commit:ci-workflow: self-ci.ymland the App secrets;release-createdandtag-name;paths-releasednamingpackages/dev-config.This changes this repository's own release path. Its first real run is the next push to
mainafter merge, which should rebuild the open release PRs and dispatchself-ci.ymlon them, as today.Not breaking for consumers: a new workflow.
How to verify
make checkpasses: exit 0.test/dispatch-at-tag.bats(new, 7 cases):gh workflow run … --ref TAG -f …with{tag}filled in;#lines are skipped;key=value, fails before anything starts;TAGorGH_REPOis named.test/release-pr-read.bats(new, 4 cases): outputs are written; empty or unset, non-object and incomplete inputs are fatal and write nothing.test/release-summary.bats(new, 3 cases).test/dispatch-release-pr-ci.bats: now at the new path; two new cases (CI_WORKFLOWdecides the workflow; missing, it fails before any dispatch).test/workflow-shape.bats:prs_createdandci-workflow, readingprs; the tag dispatch gated onrelease_createdanddispatch-on-release, attag_name; the PR read andpr-numberwiring; the App token only with its secrets;contents: writenow asked for by four jobs;major-tagcomparesrelease-created.test/self-workflows.bats:self-release.ymlcalls the local workflow withself-ci.ymland the three secrets; the CI workflow it names exists; the dev-config gate; the rehearsal gate onrelease-created.test/consumer-contract.bats: every input is in the guide's table.docs/consumer-guide.mdandAGENTS.md).Docs
docs/consumer-guide.md:pr-release.ymlsection: why, inputs, outputs, secrets, the caller example, and the merge-method note;AGENTS.md:scripts/release/);README.md: the table row and the counts.The template adopts it after it moves its pin to the release carrying this:
cd-release.ymlbecomes the caller in the guide, withdispatch-on-releaseholding the beta start and its web-deploy line inside theinitmarkers.Checklist
make checkpasses locallydocs/consumer-guide.mdupdated: a new workflow