Skip to content

Commit 35a8589

Browse files
committed
Do not assume target branch is on the same fork as the CI
1 parent 31f1bbd commit 35a8589

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
@@ -36,6 +36,7 @@ jobs:
3636
3737
# Get the source branch name and target branch
3838
SOURCE_BRANCH="${{ github.head_ref }}"
39+
SOURCE_SHA="${{ github.event.pull_request.head.sha }"
3940
TARGET_BRANCH="${{ steps.target-branch.outputs.branch }}"
4041
SYNC_BRANCH="sync-${SOURCE_BRANCH}-to-${TARGET_BRANCH}"
4142
@@ -55,7 +56,7 @@ jobs:
5556
git checkout -b $SYNC_BRANCH origin/$TARGET_BRANCH
5657
5758
# Get all commits from the PR
58-
COMMITS=$(git log --reverse --format="%H" origin/$TARGET_BRANCH..origin/$SOURCE_BRANCH)
59+
COMMITS=$(git log --reverse --format="%H" origin/$TARGET_BRANCH..$SOURCE_SHA)
5960
6061
# Cherry-pick each commit
6162
echo "Cherry-picking commits..."

0 commit comments

Comments
 (0)