Skip to content

Backport #2518 to releases/v2–v6: skip unsafe PR check on default checkout#2520

Closed
aiqiaoy with Copilot wants to merge 1 commit into
mainfrom
copilot/backport-2518-to-v2-v6
Closed

Backport #2518 to releases/v2–v6: skip unsafe PR check on default checkout#2520
aiqiaoy with Copilot wants to merge 1 commit into
mainfrom
copilot/backport-2518-to-v2-v6

Conversation

Copilot AI commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Default self-checkouts (same repo, no explicit ref) were incorrectly triggering the assertSafePrCheckout guard on pull_request_target events when the event SHA matched the PR head SHA — a false positive introduced with the allow-unsafe-pr-checkout feature.

Changes

  • src/input-helper.ts — Wrap assertSafePrCheckout with an isDefaultCheckout guard; skip the check when the caller hasn't customized repository or ref:
    const isDefaultCheckout = isWorkflowRepository && !core.getInput('ref')
    if (!isDefaultCheckout) {
      unsafePrCheckoutHelper.assertSafePrCheckout({ ... })
    }
  • __test__/input-helper.test.ts — Two new tests: default self-checkout on fork pull_request_target succeeds; explicit fork repository is still refused.
  • dist/index.js — Rebuilt artifact (v4–v6 via ncc build; v2–v3 patched directly due to pre-existing uuid/v4 ncc bundling incompatibility on those branches).

Applied identically to five branches: copilot/backport-2518-releases-v6, v5, v4, v3, v2 — each branched from its respective releases/vN base.

Copilot AI changed the title [WIP] Backport PR 2518 to release branches v2-v6 Backport #2518 to releases/v2–v6: skip unsafe PR check on default checkout Jul 15, 2026
Copilot AI requested a review from aiqiaoy July 15, 2026 15:05
@aiqiaoy aiqiaoy closed this Jul 15, 2026
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.

backport https://github.com/actions/checkout/pull/2518 to v2-v6 release branches

2 participants