Skip to content

Commit c545656

Browse files
Merge pull request #435 from holly-cummins/fix-syncbot-empty-cherry-pick
Skip empty cherry-picks in syncbot
2 parents 830127f + 5f6ea24 commit c545656

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/syncbot.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,16 @@ jobs:
6464
for commit in $COMMITS; do
6565
echo "Cherry-picking $commit"
6666
git cherry-pick $commit || {
67-
echo "Cherry-pick failed for $commit"
68-
git cherry-pick --abort
69-
echo "cherry_pick_failed=true" >> $GITHUB_OUTPUT
70-
exit 1
67+
# If the cherry-pick is empty (change already exists on target), skip it
68+
if git diff --cached --quiet; then
69+
echo "Cherry-pick of $commit is empty (already applied), skipping"
70+
git cherry-pick --skip
71+
else
72+
echo "Cherry-pick failed for $commit"
73+
git cherry-pick --abort
74+
echo "cherry_pick_failed=true" >> $GITHUB_OUTPUT
75+
exit 1
76+
fi
7177
}
7278
done
7379

0 commit comments

Comments
 (0)