Skip to content

Commit 5f6ea24

Browse files
holly-cumminsclaude
andcommitted
Skip empty cherry-picks instead of failing
When a commit has already been applied to the target branch, the cherry-pick produces an empty result. Detect this case via `git diff --cached --quiet` and skip it rather than aborting the entire sync. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 830127f commit 5f6ea24

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)