Commit bd62aa4
committed
fix(ci): pass App token to checkout so the persisted git credential is App-authored
Copilot caught a real gap in the previous commit on this PR:
setting `env.GITHUB_TOKEN` for changesets/action only affects
the action's Octokit calls (PR creation, etc.). The actual
`git push origin changeset-release/main` that changesets/action
performs uses **git's persisted remote credential**, not the env
var. `actions/checkout@v6` persists `secrets.GITHUB_TOKEN` into
git config by default, so the push was still GITHUB_TOKEN-
authored — the workflow-trigger suppression we were trying to
bypass would have continued to bite.
Fix:
- Mint the App token *before* checkout (was: after `pnpm build`).
- Pass it to checkout via `token: ${{ steps.app-token.outputs.token }}`,
so the persisted credential is the App token's.
- changesets/action's `env.GITHUB_TOKEN` stays on the App token
(it was already correct; this just makes the push credential
align with the API credential).
Side-effect: the trailing "Update floating v<major> tag" step
now also pushes under the App identity (because it uses the
same persisted git credential). That's fine — the App has
`Contents: write`, and the tag push doesn't trigger any
workflow we care about, so the broader-permission credential
changes nothing functional there.1 parent 267ea4b commit bd62aa4
1 file changed
Lines changed: 12 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
22 | 33 | | |
23 | 34 | | |
24 | 35 | | |
| 36 | + | |
25 | 37 | | |
26 | 38 | | |
27 | 39 | | |
| |||
32 | 44 | | |
33 | 45 | | |
34 | 46 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | 47 | | |
41 | 48 | | |
42 | 49 | | |
| |||
0 commit comments