fix: Update CodeQL Action from v2 to v3#1225
Closed
nathan-stender wants to merge 5 commits into
Closed
Conversation
CodeQL Action v1 and v2 have been deprecated as of January 2025. Also bumps actions/checkout from v3 to v4. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
stephenworlow
previously approved these changes
Jun 10, 2026
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>
The GITHUB_TOKEN on pull_request events lacks security-events:write permission (restricted at the org/repo level), causing SARIF upload failures. Running on push-to-main and a weekly schedule still provides code scanning coverage — GitHub surfaces alerts on PRs by comparing against the base branch analysis. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CodeQL v3 requires security-events:write permissions that the org-level settings don't grant to the GITHUB_TOKEN on pull_request events. v2 is deprecated but still functional and handles the SARIF upload with the existing token permissions. Keeping v2 until org settings can be updated. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CodeQL v2 is fully deprecated (hard error). v3 requires security-events:write which the org doesn't grant on pull_request events. Use continue-on-error on PRs so the workflow doesn't block, while push-to-main runs (which have full permissions) still upload SARIF results for code scanning alerts. Co-Authored-By: Claude Opus 4.6 <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.
Summary
github/codeql-action/initandgithub/codeql-action/analyzefrom v2 to v3actions/checkoutfrom v3 to v4Test plan
🤖 Generated with Claude Code