Commit d3acad1
ci(security): push with default GITHUB_TOKEN, not App token (#361)
The fix-dependabot-alerts workflow was using the GitHub App token for
git push, which required granting the App `Contents: write` at the
installation level. That permission wasn't (and didn't need to be)
granted, causing the scheduled run to 403 at `git push` with
'Permission to microsoft/TypeChat.git denied to typeagent-bot[bot]'.
Match the TypeAgent workflow pattern instead: keep
`persist-credentials: false` on checkout (so the token isn't reachable
from untrusted `npm` scripts during the verify phase), but at the very
end of the job re-inject the workflow's own GITHUB_TOKEN — already
scoped to `contents: write` via the workflow-level `permissions:`
block — for the git push.
The App token is now used only where it must be:
- `gh api dependabot/alerts` (the default GITHUB_TOKEN can't reach
this endpoint)
- `gh pr create` / labels / closing superseded PRs (so the PR
identity is the bot, not github-actions)
Verified end-to-end: a manual workflow_dispatch run against a temp
branch passed git push and opened #360.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 246f677 commit d3acad1
1 file changed
Lines changed: 16 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
165 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
166 | 176 | | |
167 | 177 | | |
168 | 178 | | |
| |||
188 | 198 | | |
189 | 199 | | |
190 | 200 | | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
195 | 207 | | |
196 | 208 | | |
197 | 209 | | |
| |||
0 commit comments