Skip to content

Commit 147d71c

Browse files
holly-cumminsclaude
andcommitted
Fetch PR head ref to fix cherry-pick for fork PRs
The PR head SHA may not exist locally when the PR comes from a fork, since git fetch origin only fetches base repo branches. Explicitly fetch the PR ref via refs/pull/N/head so the SHA is available for the cherry-pick revision range. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5e3b839 commit 147d71c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

.github/workflows/syncbot.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ jobs:
3131
git config user.name syncbot
3232
git config user.email github-actions@github.com
3333
34-
# Fetch all branches
34+
# Fetch all branches and the PR head (which may be from a fork)
3535
git fetch origin
36+
git fetch origin pull/${{ github.event.pull_request.number }}/head
3637
3738
# Get the source branch name and target branch
3839
SOURCE_BRANCH="${{ github.head_ref }}"

0 commit comments

Comments
 (0)