Skip to content

Commit abf8906

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

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/syncbot.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
prep-changes:
1111
runs-on: ubuntu-latest
12-
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
12+
if: github.event.workflow_run.event == 'pull_request'
1313
steps:
1414
- uses: actions/checkout@v6
1515

@@ -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)