Skip to content

[CI]: Fix fork-PR checkout blocked by security guard, keep auto-approve/reject#2159

Merged
YevhS merged 2 commits into
masterfrom
fix-fork-checkout-security-guard
Jul 21, 2026
Merged

[CI]: Fix fork-PR checkout blocked by security guard, keep auto-approve/reject#2159
YevhS merged 2 commits into
masterfrom
fix-fork-checkout-security-guard

Conversation

@YevhS

@YevhS YevhS commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

GitHub hardened actions/checkout to refuse checking out fork PR code from a pull_request_target workflow (the "pwn request" guard), so every student fork PR failed at checkout. This splits the workflow so untrusted student code never runs with a write-scoped token, while preserving the auto-approve / auto-reject verdict:

  • test.yml now triggers on pull_request (read-only token) and runs the existing checks against the student's code via the default checkout; it uploads the PR number as an artifact.
  • pr-review.yml triggers on workflow_run (trusted context, write token) and posts approve (on success) or request-changes (on failure).

Note: pr-review.yml only arms once it is on the default branch.

@YevhS
YevhS merged commit 9a48e77 into master Jul 21, 2026
0 of 3 checks passed
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