Skip to content

fix(ci): allow safe fork PR checkout in pull_request_target workflows - #35068

Merged
aramissennyeydd merged 1 commit into
masterfrom
sennyeya/pull_request_target
Aug 3, 2026
Merged

fix(ci): allow safe fork PR checkout in pull_request_target workflows#35068
aramissennyeydd merged 1 commit into
masterfrom
sennyeya/pull_request_target

Conversation

@aramissennyeydd

Copy link
Copy Markdown
Contributor

Hey, I just made a Pull Request!

actions/checkout v6.1.0 (backported from v7) now refuses to check out fork pull request code in pull_request_target workflows — by head SHA, merge_commit_sha, or refs/pull/*/{head,merge} — unless allow-unsafe-pr-checkout: true is set. This broke three of our pull_request_target workflows that use exactly those checkout patterns:

  • automate_yarn-lock-changes.yml
  • automate_changeset_feedback.yml
  • automate_merge_message.yml

None of them execute the checked-out fork code (no install/build/run steps against it — they only diff it or run trusted scripts fetched from master), and automate_merge_message.yml only runs after the PR is already merged. So opting back in with allow-unsafe-pr-checkout: true is safe for these, and each has a comment explaining why.

See actions/checkout#2500 and https://github.blog/changelog/2026-06-18-safer-pull_request_target-defaults-for-github-actions-checkout/ for background.

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)
actions/checkout v6.1.0 backported a breaking security change that
refuses to check out fork pull request code (by SHA, merge commit, or
refs/pull/*/{head,merge}) in pull_request_target workflows unless
allow-unsafe-pr-checkout is explicitly set. This broke the yarn-lock
diff, changeset feedback, and merge message workflows, none of which
execute the checked-out fork code, so opting back in is safe.

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
@aramissennyeydd
aramissennyeydd requested a review from a team as a code owner August 3, 2026 18:58
Copilot AI review requested due to automatic review settings August 3, 2026 18:58
@backstage-goalie backstage-goalie Bot added size:small Small pull requests receive a slightly higher priority for reviews. waiting-for:review The PR needs a review and will be visible in the review queue unless already assigned an owner. labels Aug 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates three pull_request_target GitHub Actions workflows to opt back into checking out fork PR refs under the newer actions/checkout safety defaults, while documenting why doing so is safe for these specific jobs (they only diff/read content or run trusted scripts).

Changes:

  • Set allow-unsafe-pr-checkout: true for fork PR checkouts in affected pull_request_target workflows.
  • Add inline comments in each workflow describing why the opt-in remains safe for that job’s behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
.github/workflows/automate_yarn-lock-changes.yml Opts into unsafe PR checkout for merge ref; workflow only reads/diffs yarn.lock changes.
.github/workflows/automate_merge_message.yml Opts into unsafe PR checkout for merge_commit_sha; job only runs post-merge and executes a trusted script fetched from master.
.github/workflows/automate_changeset_feedback.yml Opts into unsafe PR checkout for merge ref; workflow diffs PR content and posts comments using scoped app credentials.
@backstage-goalie backstage-goalie Bot added waiting-for:merge The PR has been approved and is awaiting merge. and removed waiting-for:review The PR needs a review and will be visible in the review queue unless already assigned an owner. labels Aug 3, 2026
@aramissennyeydd
aramissennyeydd merged commit 1cbb021 into master Aug 3, 2026
27 checks passed
@aramissennyeydd
aramissennyeydd deleted the sennyeya/pull_request_target branch August 3, 2026 20:18
awanlin pushed a commit to awanlin/backstage that referenced this pull request Aug 3, 2026
…backstage#35068)

actions/checkout v6.1.0 backported a breaking security change that
refuses to check out fork pull request code (by SHA, merge commit, or
refs/pull/*/{head,merge}) in pull_request_target workflows unless
allow-unsafe-pr-checkout is explicitly set. This broke the yarn-lock
diff, changeset feedback, and merge message workflows, none of which
execute the checked-out fork code, so opting back in is safe.

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:small Small pull requests receive a slightly higher priority for reviews. waiting-for:merge The PR has been approved and is awaiting merge.

3 participants