fix(ci): allow CodeQL to check out fork PR head SHA - #220
Merged
Conversation
actions/checkout@v7 added a guard that refuses to check out a fork pull request's head SHA inside a pull_request_target workflow unless explicitly opted in, breaking CodeQL analysis on every fork-originated PR (e.g. #208) since the checkout v6 -> v7 bump. Set allow-unsafe-pr-checkout: true, which is safe for this workflow: it carries no secrets and permissions are scoped to security-events:write and contents:read only, per the existing threat-model comment.
bug-ops
force-pushed
the
fix/codeql-fork-pr-checkout
branch
from
July 24, 2026 18:46
98dd86f to
a78474f
Compare
bug-ops
enabled auto-merge (squash)
July 24, 2026 18:46
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
actions/checkout@v7refuses to check out a fork pull request's head SHA inside apull_request_targetworkflow unless explicitly opted in (a new "pwn request" guard) — this has been failing CodeQL analysis on every fork-originated PR (e.g. docs: add ty language server configuration #208) since the checkout v6 -> v7 bumpallow-unsafe-pr-checkout: trueon the CodeQL workflow's checkout steppermissions: {}) and the analyze job's permissions are scoped tosecurity-events: write+contents: readonly, matching the threat-model comment already documented in the workflowTest plan
fy lint .github/workflows/codeql.yml— no errors (pre-existing style infos only)Analyze (actions)/Analyze (rust)pass once this merges and PR docs: add ty language server configuration #208 (or another fork PR) re-runs CodeQL