Commit 60e3bc2
ci: set least-privilege GITHUB_TOKEN permissions (#7)
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 fa79b49 commit 60e3bc2
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
| |||
0 commit comments