Skip to content

Commit c2c3939

Browse files
fix: Move permissions to workflow level for CodeQL SARIF upload
The SARIF upload was failing with "Requires authentication" because job-level permissions may not be sufficient when the repo's default token is restricted. Moving permissions to the workflow level ensures the GITHUB_TOKEN has security-events:write for uploading results. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent cd5d5b1 commit c2c3939

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,17 @@ on:
1515
push:
1616
branches: [ "main" ]
1717
pull_request:
18-
# The branches below must be a subset of the branches above
1918
branches: [ "main" ]
2019

20+
permissions:
21+
security-events: write
22+
contents: read
23+
actions: read
24+
2125
jobs:
2226
analyze:
2327
name: Analyze
2428
runs-on: 'ubuntu-latest'
25-
permissions:
26-
actions: read
27-
contents: read
28-
security-events: write
29-
packages: read
3029

3130
strategy:
3231
fail-fast: false

0 commit comments

Comments
 (0)