Skip to content

fix(ci): align caller permissions with pinned reusables (secret-scanner, scorecards)#299

Merged
hyperpolymath merged 1 commit into
mainfrom
fix/ci-caller-permissions-drift
Jul 1, 2026
Merged

fix(ci): align caller permissions with pinned reusables (secret-scanner, scorecards)#299
hyperpolymath merged 1 commit into
mainfrom
fix/ci-caller-permissions-drift

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

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

…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>
@hyperpolymath
hyperpolymath merged commit dc7fe83 into main Jul 1, 2026
34 of 43 checks passed
@hyperpolymath
hyperpolymath deleted the fix/ci-caller-permissions-drift branch July 1, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant