Skip to content

Commit 7aa4833

Browse files
committed
ci: also unblock pr-security-review fork checkout (author-gated, read-only)
Completes the checkout@v7 fork-PR fix: pr-security-review.yml has the same pull_request_target + checkout@v7 + fork-head pattern (its ref is computed in a step, so it was easy to miss). Unlike e2e/pr-tarball, this job: - is ALREADY gated on the PR author's write/admin permission (getCollaboratorPermissionLevel), so external forks already skip it, and - only READS the code (compute diff, build prompt, run the review) — it never executes fork code (no npm ci / npm scripts). So `allow-unsafe-pr-checkout: true` is the correct, low-risk fix here (reviewing the PR head is the job's whole purpose), whereas for the secret-executing e2e/pr-tarball jobs we instead moved to author-based gating and dropped the flag.
1 parent e4b29e3 commit 7aa4833

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

.github/workflows/pr-security-review.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@ jobs:
160160
with:
161161
ref: ${{ steps.pr.outputs.head_sha }}
162162
fetch-depth: 0
163+
# Safe to opt in here: the `authorize` job already gates on the PR AUTHOR having write/admin
164+
# (getCollaboratorPermissionLevel), and this job only READS the code (compute diff, build
165+
# prompt, run the review) — it never executes fork code (no npm ci / npm scripts). checkout@v7
166+
# otherwise refuses fork-PR checkout in pull_request_target, which would break the review on
167+
# an authorized author's fork PR. Reviewing the PR head is the whole point of this job.
168+
allow-unsafe-pr-checkout: true
163169

164170
- name: Compute diff
165171
id: diff

0 commit comments

Comments
 (0)