Skip to content

Commit dc7fe83

Browse files
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

File tree

.github/workflows/scorecard.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ permissions: read-all
1212

1313
jobs:
1414
analysis:
15+
# Job-level permissions REPLACE the workflow-level read-all block, so
16+
# contents: read must be restated here — the reusable declares it
17+
# (checkout needs it) and startup-fails if the caller doesn't grant it.
1518
permissions:
1619
security-events: write
1720
id-token: write
21+
contents: read
1822
uses: hyperpolymath/standards/.github/workflows/scorecard-reusable.yml@d7c22711e830e1f383846472f6e9b99debdb201e # main 2026-05-28 (SPDX bump #249)
1923
secrets: inherit

.github/workflows/secret-scanner.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,12 @@ permissions:
1515

1616
jobs:
1717
scan:
18+
# The reusable's gitleaks job requests pull-requests: write (PR summary
19+
# comment) and actions: read (workflow-run metadata) at job level; the
20+
# caller must grant at least that or the run startup-fails.
21+
permissions:
22+
contents: read
23+
pull-requests: write
24+
actions: read
1825
uses: hyperpolymath/standards/.github/workflows/secret-scanner-reusable.yml@d135b05bfc647d0c0fbfedc7e80f37ea50f49236 # main 2026-05-28 (SPDX bump #249 + pragma/.shell-secrets-ignore fix #236)
1926
secrets: inherit

0 commit comments

Comments
 (0)