Commit 448891e
chore(security): scope workflow token permissions to jobs that need writes
Addresses OSSF Scorecard's Token-Permissions check (currently 0/10).
Three workflows granted write scopes at the top level, which leaks
permission scope to any future job added to the workflow. Moving the
writes to the single job in each file that actually needs them and
leaving the top level at contents: read, which is Scorecard's
preferred restrictive default.
publish-npm.yml:
top level: contents: read (was: contents: write, id-token: write)
publish-npm job: contents: write (gh release upload),
id-token: write (npm trusted publishing OIDC)
release-please.yml:
top level: contents: read (was: contents: write, pull-requests: write)
release-please job: contents: write (release commits and tags),
pull-requests: write (release PR updates)
upstream-pass-cli-watch.yml:
top level: contents: read (was: contents: write, pull-requests: write)
watch-upstream job: contents: write (peter-evans/create-pull-request
pushes the chore branch),
pull-requests: write (open the PR)
No functional change - the actions that need the writes still have
them via job-level grants. Verified with the ossf-scorecard plugin's
workflow-audit skill: token-permissions domain now reports 0 findings.
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent c04ed6e commit 448891e
File tree
3 files changed
+21
-6
lines changed- .github/workflows
3 files changed
+21
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
17 | 22 | | |
18 | 23 | | |
19 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
16 | 21 | | |
17 | 22 | | |
18 | 23 | | |
| |||
0 commit comments