fix(ci): align caller permissions with pinned reusables (secret-scanner, scorecards)#299
Merged
Merged
Conversation
…er, scorecards) Both workflows startup-failed on main from the same root cause class: caller-vs-reusable permissions drift. - Secret Scanner: the pinned reusable's gitleaks job requests pull-requests: write + actions: read at job level, but the caller granted only contents: read workflow-wide. Grant exactly those three on the scan job. - Scorecards: the caller's job-level permissions block (security-events + id-token) replaces the workflow-level read-all entirely, dropping contents: read that the reusable declares for checkout. Restate contents: read in the job block. Minimum-necessary grants only; no write-all. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Two workflows are
startup_failureon 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 ownpermissions: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 itsgitleaksjob:pull-requests: write— gitleaks-action posts a PR summary commentactions: read— workflow-run metadata / PR-files endpoints(the reusable's own header comment says callers must grant these). The caller granted only
contents: readworkflow-wide. Fix: grant exactlycontents: read+pull-requests: write+actions: readon thescanjob.Scorecards (
.github/workflows/scorecard.yml)The caller's job-level
permissions:block (security-events: write,id-token: write) replaces the workflow-levelread-allentirely, droppingcontentstonone. The pinned reusable (standards/scorecard-reusable.yml@d7c2271) declares workflow-levelcontents: read(checkout needs it). Fix: restatecontents: readin the job-level block.Minimum-necessary grants only — no
write-all, nothing beyond what each pinned reusable declares.🤖 Generated with Claude Code