feat(NO-TASK): Add a reusable workflow to sync release-please config - #152
Open
aaronware wants to merge 1 commit into
Open
feat(NO-TASK): Add a reusable workflow to sync release-please config#152aaronware wants to merge 1 commit into
aaronware wants to merge 1 commit into
Conversation
release-please has no `extends`, and it reads its config through the GitHub API off the target branch - github.getFileJson(configFile, branch) - not from the workflow checkout. So a shared standard can neither be referenced nor generated at release time: the JSON has to be committed in every repo that uses it. Across ~30 repos that would mean a hand-made pull request each time the standard changes. This makes the npm version the carrier instead. Renovate bumps @linchpinagency/release-please-config, this workflow regenerates the committed JSON onto that same pull request, and the existing auto-approve-maintenance / auto-merge-maintenance path takes it from there - release-please-config.json is already on both allow-lists, so none of that needed changing. Regeneration runs the version the pull request just installed, via `npx --no-install`, never @latest. The lockfile stays the source of truth and the `check` job in each consumer is deterministic. Two guards live in the workflow rather than the caller, because it combines a pull_request trigger with a PAT and a checkout of the head ref: same-repository pull requests only, and the expected bot only. Co-Authored-By: Claude Opus 5 (1M context) <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.
Adds a reusable workflow that regenerates a consumer's committed
release-please-config.jsonwhen Renovate bumps the shared standard.Why this exists
release-please has no
extends, and it reads its config through the GitHub API off the target branch —github.getFileJson(configFile, branch)— not from the workflow's checkout. So a shared standard can neither be referenced nor generated at release time. The JSON has to be committed in every repo that uses it.Across ~28 repos, that would mean a hand-made pull request each time the standard changes.
How it avoids that
@linchpinagency/release-please-configships the standard on npm, so the version bump becomes the carrier:release-please-config.jsonis already on both maintenance allow-lists, so neither of those workflows needed changing.Design notes worth reviewing
npx --no-installis load-bearing. It makes the run fail rather than silently fetch from the registry, so regeneration can only ever use the version the lockfile just pinned. The lockfile stays the source of truth and the consumer'scheckjob is deterministic — never@latest.Two guards live in the workflow, not the caller, because it combines a
pull_requesttrigger with a PAT and a checkout of the head ref:allowed_actor, defaultrenovate[bot])Wiring this up loosely from a caller therefore can't turn it into an arbitrary-code path.
GH_BOT_TOKENrather thangithub.token, because a push made withgithub.tokendoes not trigger workflow runs — the PR's own checks would never re-run against the commit this job adds.It commits as
renovate[bot]so the PR keeps one author andauto-merge-maintenance'sauthor == renovate[bot]guard still holds.git addis scoped to the one file. If a future sync ever touched anything else, it would be left uncommitted rather than swept into a PR that auto-merges.Rebase, not merge, before pushing — Renovate force-pushes its branches, and a merge commit would confuse its next update.
concurrencyserialises runs per PR and never cancels mid-flight, so a run can't be killed between its commit and its push.Independent of #149
The README section is written against
main, not against thecheck-overridescontent, so this does not depend on #149 merging.Not yet released
Needs a
v4tag move before consumers referencing@v4pick it up.