Skip to content

ci: opt in to fork-PR checkout after the actions/checkout guard change#109

Open
edenbd1 wants to merge 1 commit into
logos-co:masterfrom
edenbd1:fix-fork-checkout-guard
Open

ci: opt in to fork-PR checkout after the actions/checkout guard change#109
edenbd1 wants to merge 1 commit into
logos-co:masterfrom
edenbd1:fix-fork-checkout-guard

Conversation

@edenbd1

@edenbd1 edenbd1 commented Jul 20, 2026

Copy link
Copy Markdown

Every submission PR from a fork currently fails validate, including ones whose content is fine. The job dies at Checkout PR head and the Run validation step is skipped, so the workflow never reads the submission at all.

Cause

actions/checkout v4.4.0 was published on 2026-07-20 at 15:36 UTC and backported a guard that refuses to check out fork pull-request code from a pull_request_target workflow. The previous v4 release was v4.3.1, from 2025-11-17, so this workflow picked the new behaviour up through the floating @v4 tag without changing on its own side.

Refusing to check out fork pull request code from a 'pull_request_target' workflow.
... To opt in ... set 'allow-unsafe-pr-checkout: true' on the actions/checkout step.

Verification

I reproduced it in a scratch repository rather than guessing, holding everything constant but one variable at a time: https://github.com/test-readme/checkout-guard-repro

# Fork PR? checkout ref opt-in Result
1 yes @v4 (now v4.4.0) no failure
2 yes @v4.3.1 pinned no success
3 yes @v4 yes success
4 no @v4 no success

Runs 1 and 2 isolate the cause: same pull request, same content, only the action version differs. Runs 1 and 4 isolate the trigger: only the fork differs. Run 3 is this patch.

The change

One line on the step that checks out the fork's head. That step reads the checked-out files as data, never executes them, and already sets persist-credentials: false, so opting in restores the previous behaviour without widening what the workflow trusts. Pinning to @v4.3.1 would also work but leaves the guard off indefinitely.

Found this while looking into why the validate job went red on #64. Happy to close if you would rather handle it differently.

actions/checkout v4.4.0, published 2026-07-20 at 15:36 UTC, backported a guard
that refuses to check out fork pull-request code from a pull_request_target
workflow. The previous v4 release was v4.3.1 from 2025-11-17, so any workflow on
the floating @v4 tag picked the new behaviour up without changing on its own
side. Every submission PR from a fork now fails at the checkout step, before the
validation script runs at all.

The affected step only reads the checked-out files as data, never executes them,
and already sets persist-credentials: false, so opting in restores the previous
behaviour without widening what the workflow trusts.

Verified on a four-run reproduction at
https://github.com/test-readme/checkout-guard-repro : a fork PR on @v4 fails, the
same PR on @v4.3.1 passes, the same PR on @v4 with this opt-in passes, and a
same-repo PR on @v4 passes without it.
@github-actions

Copy link
Copy Markdown

⚠️ Validation script did not produce output.

@edenbd1

edenbd1 commented Jul 20, 2026

Copy link
Copy Markdown
Author

One thing worth flagging so the red check here does not read as a contradiction: this PR's own validate run fails, at the same step, for the same reason.

pull_request_target runs the workflow definition from the base branch, not from the pull request. So until this is merged into master, every fork PR keeps using the unpatched workflow, this one included. Run 3 in the reproduction table is the evidence that the patch works, since there the fix was already on the base branch when the fork PR ran.

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