Commit 195f747
ci: set least-privilege GITHUB_TOKEN permissions (#104)
Add top-level `permissions: contents: read` to every workflow. Without
it, jobs inherit the repo-default token scope (often read-write), so a
malicious dependency executing during install/build/test on a push to
the default branch would hold a write-capable token. Read-only by
default denies that; the publish job keeps its own job-level
`id-token: write` block (job-level permissions override the top-level
default), so trusted-publishing is unaffected.
Complements the SHA-pinning: pinning stops untrusted code from running;
this limits what it can do if it runs anyway. Fork-PR tokens are already
forced read-only by GitHub; this closes the push-triggered path.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent c87c5b8 commit 195f747
2 files changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
| |||
0 commit comments