Repository navigation
fix(playwright-ci): verify safe-to-test label on fork PRs via API check [2.0] - #36136
Conversation
verify-pr-label-action v1.4.0 hard-fails on pull_request events for any cross-repository PR (`ERROR: PRs from forks are only supported when trigger on pull_request_target`), so fork PRs targeting release branches could never pass the safe-to-test gate. main is unaffected because its PR-triggered runs skip via the merge-queue dispatcher; 2.0 has no merge queue and must run CI on the PR event. Keep the action for same-repo PRs and check the label with a read-only gh api call for fork PRs, preserving the safe-to-test gate for both. Adds the minimal issues:read scope needed to list labels.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved🔴 High risk · The fork-PR label check controls whether untrusted code runs in CI; a misapplied label could authorize unintended workflow execution. Replaces the failing VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
For pull requests, GET /repos/{repo}/issues/{n}/labels accepts either
the Issues or the Pull requests repo permission (read) per the REST
docs, so the existing pull-requests: read covers the fork-PR label
check. Reading labels from PRs does not require the issues scope.
Context
PR CI fails for any PR coming from a fork targeting a release branch (observed on a fork PR targeting
2.0, run 39987235690). Thebuildjob ofplaywright-postgresql-e2e.ymlverifies thesafe to testlabel withjesusvasquez333/verify-pr-label-action@v1.4.0, which hard-fails on every cross-repository PR under thepull_requestevent:This comes from the action's own guard (
verify_pr_lables.py, v1.4.0):It is independent of the base branch and of the labels already on the PR — so on release branches (no merge queue, CI must run on the PR event) a fork PR can never pass, even after a maintainer applies
safe to test.mainis unaffected but only by accident: after #34740 its PR-triggered Playwright runs skip everything, so the fork path is never exercised there. Release branches (2.0,1.13) still carry the PR-gated workflow.Why the action can't just be run under
pull_request_targetThe workflow deliberately runs unprivileged on
pull_request(it builds and caches PR code); switching topull_request_targetwould run fork code with base-branch workflow context, which this repo explicitly avoids.Change
Keep the action for same-repo PRs, and for fork PRs check the same label with a read-only
gh apicall — same gate, samelabeled-event re-trigger:No extra workflow scope is needed: for pull requests,
GET /repos/{repo}/issues/{n}/labelsaccepts either the Issues or the Pull requests repo permission (read) per the REST docs ("List labels for an issue"), so the existingpull-requests: readcovers it.safe to test" message instead of the third-party refusal.main: untouched (no dispatcher change).The same gate exists in the
1.13release-branch copy of this workflow; happy to port the fix if maintainers prefer it applied there too.Testing
actionlintnot available locally.buildnow waits at the fork label check untilsafe to testis applied, instead of erroring out with the action's fork message.

Confidence Score: 5/5
The PR appears safe to merge.Summary
Fork PRs now check the
safe to testlabel throughgh api. Same-repository PRs keep the existing action.Reviews (2) · Last reviewed commit: "fix(playwright-ci): drop unneeded issues..." · Reviewed by Greptile