Commit dc7fe83
fix(ci): align caller permissions with pinned reusables (secret-scanner, scorecards) (#299)
## Problem
Two workflows are `startup_failure` on main (runs 28549269067,
28549269182 at head 2909ca6), both from the same root cause class:
**caller-vs-reusable permissions drift**. When a caller grants the
reusable less than the reusable's own `permissions:` declarations
request, GitHub refuses to start the run.
## Fixes
**Secret Scanner** (`.github/workflows/secret-scanner.yml`)
The pinned reusable (`standards/secret-scanner-reusable.yml@d135b05`)
declares on its `gitleaks` job:
- `pull-requests: write` — gitleaks-action posts a PR summary comment
- `actions: read` — workflow-run metadata / PR-files endpoints
(the reusable's own header comment says callers must grant these). The
caller granted only `contents: read` workflow-wide. Fix: grant exactly
`contents: read` + `pull-requests: write` + `actions: read` on the
`scan` job.
**Scorecards** (`.github/workflows/scorecard.yml`)
The caller's job-level `permissions:` block (`security-events: write`,
`id-token: write`) **replaces** the workflow-level `read-all` entirely,
dropping `contents` to `none`. The pinned reusable
(`standards/scorecard-reusable.yml@d7c2271`) declares workflow-level
`contents: read` (checkout needs it). Fix: restate `contents: read` in
the job-level block.
Minimum-necessary grants only — no `write-all`, nothing beyond what each
pinned reusable declares.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent 2909ca6 commit dc7fe83
2 files changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| 21 | + | |
18 | 22 | | |
19 | 23 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
18 | 25 | | |
19 | 26 | | |
0 commit comments