Commit 4b725c669b for woocommerce
commit 4b725c669b5484b7c35498d0e82275087c8410f9
Author: Alba Rincón <albarin@users.noreply.github.com>
Date: Wed Feb 4 09:32:34 2026 +0100
Skip cherry-pick when only changelog files changed (#63022)
* Fix empty cherry-pick handling to skip instead of fail
When a cherry-pick results in no changes (because the commit already
exists in the target branch), the workflow now skips the cherry-pick
instead of failing.
Detection uses git's internal state: CHERRY_PICK_HEAD exists (mid
cherry-pick) with nothing staged (empty diff).
* Skip cherry-pick when only changelog files changed
* Improve the regex
diff --git a/.github/workflows/shared-cherry-pick.yml b/.github/workflows/shared-cherry-pick.yml
index b348cde318..1afc214c97 100644
--- a/.github/workflows/shared-cherry-pick.yml
+++ b/.github/workflows/shared-cherry-pick.yml
@@ -248,7 +248,17 @@ jobs:
# Attempt cherry-pick with explicit conflict handling
if git cherry-pick -m1 "$MERGE_COMMIT_SHA"; then
- # Success case
+ # Check if only changelog files were changed (code already exists in target branch)
+ CHANGED_FILES=$(git diff --name-only HEAD~1)
+ NON_CHANGELOG_FILES=$(echo "$CHANGED_FILES" | grep -vE "^(plugins|packages)/.*/changelog/" || true)
+
+ if [[ -z "$NON_CHANGELOG_FILES" ]]; then
+ echo "status=skipped" >> $GITHUB_OUTPUT
+ echo "error_message=Cherry-pick skipped: only changelog files changed, code already exists in '$TARGET_BRANCH'." >> $GITHUB_OUTPUT
+ exit 0
+ fi
+
+ # Success case with real changes
echo "has_conflicts=false" >> $GITHUB_OUTPUT
echo "Cherry-pick completed successfully"
else