Skip to content

Fix check_task workflow failing on fork PRs - #2941

Merged
algomaster99 merged 1 commit into
2026from
fix/pull-request-target-checkout
Aug 28, 2026
Merged

Fix check_task workflow failing on fork PRs#2941
algomaster99 merged 1 commit into
2026from
fix/pull-request-target-checkout

Conversation

@algomaster99

@algomaster99 algomaster99 commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • check_task.yml runs on pull_request_target and checks out the PR's fork commit (github.event.pull_request.head.sha). actions/checkout now blocks that combination by default (checking out untrusted fork code into a privileged pull_request_target context is the "pwn request" pattern), which breaks the workflow for every fork PR — e.g. Scientific paper proposal: An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generation, week 2 #2940.
  • Split the workflow: check-affected-files and check-pr-description (no secrets used) move to plain pull_request, which is safe for fork code by design.
  • check-canvas needs secrets.CANVAS_TOKEN/GH_TOKEN to update grading, so it must stay privileged. Moved it to its own workflow file (check_task_canvas.yml) on pull_request_target, with allow-unsafe-pr-checkout: true explicitly set — safe here since the job only reads the checked-out README to diff it and never executes anything from the fork's commit.

…kout guard)

actions/checkout now refuses to check out a fork PR's head commit inside a
pull_request_target workflow unless explicitly opted in, since that
combination (untrusted code + base-repo secrets/token) is the classic
"pwn request" pattern. This broke check_task.yml for every fork PR (e.g. #2940).

Split the workflow: the two jobs that don't need secrets (check-affected-files,
check-pr-description) move to plain pull_request, which is inherently safe for
fork code. The Canvas-updating job needs base-repo secrets so it stays on
pull_request_target in its own file (check_task_canvas.yml) and explicitly
opts in to the fork checkout, since it only reads the checked-out README and
never executes anything from the fork's commit.
@algomaster99
algomaster99 merged commit 9e89b49 into 2026 Aug 28, 2026
2 checks passed
@algomaster99
algomaster99 deleted the fix/pull-request-target-checkout branch August 28, 2026 13:29
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