Skip to content

e2e: actions/checkout@v7 rejects fork PR checkouts in pull_request_target workflow #2504

Description

@ralphbean

What happens

After PR #2457 upgraded actions/checkout from v4 to v7, the e2e workflow fails on all fork PRs with:

##[error]Refusing to check out fork pull request code from a 'pull_request_target' workflow.
This workflow runs with the base repository's GITHUB_TOKEN, secrets, default-branch cache scope,
and runner access. Fetching and executing a fork's code in that trusted context commonly leads
to "pwn request" vulnerabilities. To opt in, review the risks at
https://gh.io/securely-using-pull_request_target and set 'allow-unsafe-pr-checkout: true'
on the actions/checkout step.

Observed on PR #2010 (run 27952613286). The job never reaches the test step — it fails at checkout.

What should happen

The e2e workflow should be able to check out fork PR code, with appropriate security controls. Before the v7 upgrade this worked because checkout v4 did not enforce the fork safety check.

Context

actions/checkout@v7 added a security guard that blocks fork PR checkouts in pull_request_target workflows by default. The e2e workflow uses pull_request_target because it needs access to secrets (GCP credentials, GitHub PAT) that aren't available to pull_request events on forks.

The ok-to-test label gate already provides a manual review step before e2e runs on fork PRs, which is the mitigation actions/checkout recommends verifying before opting in with allow-unsafe-pr-checkout: true.

This blocks e2e CI for all external contributors.

Metadata

Metadata

Assignees

Labels

component/ciCI pipelines and checkscomponent/e2eEnd-to-end testspriority/highSignificant impact, address soonready-to-codeTriaged and ready for the code agenttype/bugConfirmed defect in existing behavior

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions