Skip to content

Add permissions block to codeql-analysis.yml#318

Closed
areed wants to merge 1 commit intomainfrom
areed/codeql-permissions
Closed

Add permissions block to codeql-analysis.yml#318
areed wants to merge 1 commit intomainfrom
areed/codeql-permissions

Conversation

@areed
Copy link
Copy Markdown
Contributor

@areed areed commented May 7, 2026

github/codeql-action was bumped from v4.35.2 → v4.35.3 in 1fdd849 (2026-05-04). v4.35.3 calls GET /repos/{owner}/{repo}/actions/runs/{run_id} to compute the diff range for incremental analysis ("Generating diff range extension pack" in the logs). That call requires actions: read on the GITHUB_TOKEN.

code-scan.yml already declares the right permissions, but reusable-workflow permissions don't propagate to nested reusable workflows — each workflow_call file needs its own permissions: block, otherwise it falls back to the repo/org default token scopes. That's why scheduled scans started failing this week with:

Error: Resource not accessible by integration - https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run

Each scope is needed for:

  • actions: read — read workflow-run metadata for diff-range / telemetry (the failing call).
  • contents: readactions/checkout and CodeQL init reading the source tree.
  • security-events: writeanalyze step uploading SARIF results to Code Scanning.

🤖 Generated with Claude Code

github/codeql-action v4.35.3 (bumped in 1fdd849) calls the
workflow-runs API to compute the diff range for incremental
analysis. Without actions: read on the GITHUB_TOKEN, the
analyze step fails with "Resource not accessible by integration".

Permissions defined in code-scan.yml don't propagate to this
nested reusable workflow, so they need to be declared here too.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@areed areed requested a review from a team as a code owner May 7, 2026 17:53
@areed areed marked this pull request as draft May 7, 2026 17:59
@areed areed closed this May 7, 2026
@areed areed deleted the areed/codeql-permissions branch May 7, 2026 18:04
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