Skip to content

fix(ci): correct Gitleaks/Scorecard caller permissions#48

Merged
amcheste merged 4 commits into
developfrom
fix/reusable-workflow-permissions-audit-2
Jul 21, 2026
Merged

fix(ci): correct Gitleaks/Scorecard caller permissions#48
amcheste merged 4 commits into
developfrom
fix/reusable-workflow-permissions-audit-2

Conversation

@amcheste-ai-agent

Copy link
Copy Markdown
Contributor

Summary

Same permission-capping bug class as the earlier fleet audit, hitting a fresh batch of repos — these were just converted from the old inline-job CI pattern to the centralized gh-workflows caller-stub pattern, and the conversion carried the bug over.

  • Gitleaks: adds pull-requests: read, needed by gitleaks-action to list a PR's commits and compute its scan range.
  • Scorecard: replaces permissions: read-all with an explicit grant. read-all looks generous but grants nothing for id-token (it has no read level, only none/write), so the analysis job's id-token: write request was denied entirely and every run failed at startup.

Test plan

  • Merge and confirm the next Gitleaks and Scorecard runs complete instead of failing at startup.

amcheste-ai-agent and others added 2 commits July 20, 2026 14:10
reusable-gitleaks.yml (v1.1.1+) requests pull-requests: read at the
workflow level, needed by gitleaks-action to list a PR's commits and
compute its scan range. A reusable workflow can only downgrade the
caller's token, so without this grant the run fails at startup.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: amcheste <13696614+amcheste@users.noreply.github.com>
read-all looks generous but grants nothing for id-token (it has no
read level, only none/write), so the analysis job's id-token: write
request was denied entirely and every run failed at startup. Replaces
it with the explicit grant the reusable workflow's own doc documents.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: amcheste <13696614+amcheste@users.noreply.github.com>
@amcheste-ai-agent
amcheste-ai-agent Bot requested a review from amcheste as a code owner July 20, 2026 18:11
@github-actions github-actions Bot added the ci label Jul 20, 2026
Same duplicate-key bug as ccc-deploy#15, homelab-agent#13,
homelab-provisioning#10, repo-template#41 — my earlier fleet-audit fix
blindly appended pull-requests: read without checking it was already
present, producing an invalid duplicate YAML key. GitHub can't parse
the file, so the pull_request-triggered Gitleaks check never even
registered as a run.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: amcheste <13696614+amcheste@users.noreply.github.com>
@amcheste
amcheste merged commit cd2f906 into develop Jul 21, 2026
6 checks passed
@amcheste
amcheste deleted the fix/reusable-workflow-permissions-audit-2 branch July 21, 2026 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants