Commit 267ea4b
committed
ci(release): authenticate changesets/action with a GitHub App token
The "Version Packages" PR (currently #4) sits in `BLOCKED` state
because the 10 status checks required by branch protection on
`main` (CI matrix + Build + Run ghau against this repo) never
start for that PR. GitHub Actions' documented anti-loop rule
suppresses workflow triggers for pushes authored by
`GITHUB_TOKEN`, and that's exactly the token changesets/action
uses to push to `changeset-release/main`. CodeQL runs because it
bypasses the rule via default-setup, but everything else stays
idle, leaving the release PR unmergeable.
Fix: mint a short-lived installation token from a dedicated
GitHub App (`RELEASE_APP_ID` + `RELEASE_APP_PRIVATE_KEY` repo
secrets, both already configured) and pass that to
changesets/action's `GITHUB_TOKEN`. App-authored pushes trigger
workflows like a human push does, so the next time
changesets/action updates the version-PR branch, CI + the
self-check workflow run against the new tip and branch
protection clears.
The App is scoped to this repo with `Contents: Read and write` +
`Pull requests: Read and write` — exactly the perms
changesets/action needs and nothing more. No personal-account
coupling, no perma-token; the installation token is minted fresh
for each workflow run by `actions/create-github-app-token@v1`
and expires shortly after.
The trailing "Update floating v<major> tag" step keeps using the
default `GITHUB_TOKEN`-authenticated remote — a tag move doesn't
need to trigger any downstream workflow we care about, so the
broader-permission App token is unnecessary there.1 parent 5166d2c commit 267ea4b
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
42 | | - | |
| 47 | + | |
43 | 48 | | |
44 | 49 | | |
45 | 50 | | |
| |||
0 commit comments