Skip to content

ci: allow fork PR checkout under pull_request_target - #1033

Merged
stv0g merged 1 commit into
masterfrom
ci-fork-checkout-optin
Jul 30, 2026
Merged

ci: allow fork PR checkout under pull_request_target#1033
stv0g merged 1 commit into
masterfrom
ci-fork-checkout-optin

Conversation

@leonardocarreras

@leonardocarreras leonardocarreras commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

'Fork PRs still fail after #1032. actions/checkout@v7 refuses to check out fork code from a pull_request_target workflow unless allow-unsafe-pr-checkout: true is set. Approval by a member is already required by the fork-pr env, so this should be safe.

Other smaller fixes

  • GitHub refuses Actions cache writes for fork runs, so cache-to is disabled for that event. Reads are unchanged.
  • Splits the concurrency group by event so the two runs stop cancelling each other.
  • Fixes all, which was skipped instead of failed when a prerequisite failed. Only the real run claims the required check name now.
  • Compares the head repo full name instead of using head.repo.fork, which is wrong when the base repo is itself a fork.

Verified using cross-repo PR leonardocarreras#2

Signed-off-by: Leonardo Carreras <leonardo.carreras@eonerc.rwth-aachen.de>
@leonardocarreras
leonardocarreras force-pushed the ci-fork-checkout-optin branch from 928ebab to 43b108d Compare July 30, 2026 07:39
@leonardocarreras

Copy link
Copy Markdown
Contributor Author

Hi @stv0g! So, as it got tricky I tested here https://github.com/leonardocarreras/node/actions/runs/30521609262?pr=2

@leonardocarreras leonardocarreras changed the title ci: allow fork PR checkout and stop cache writes under pull_request_target ci: allow fork PR checkout under pull_request_target Jul 30, 2026
@stv0g
stv0g merged commit c752997 into master Jul 30, 2026
56 checks passed
@stv0g
stv0g deleted the ci-fork-checkout-optin branch July 30, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants