Skip to content

Commit 6b115f1

Browse files
authored
ci(sync-patches): guard conflict-resolution path against empty commits (#3124)
When all stable->main conflicts are in release-managed files (package.json versions, etc.) and auto-resolution keeps main's version for every one, the index becomes clean. The unguarded git commit then exits 1 and the workflow run shows red despite stable and main being correctly in sync. Mirror the existing 'no changes to sync' guard from the no-conflict path.
1 parent ebf1f82 commit 6b115f1

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.github/workflows/sync-patches.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@ jobs:
9393
9494
# Check if all conflicts are resolved
9595
if [ -z "$(git diff --name-only --diff-filter=U)" ]; then
96+
# If every conflict was auto-resolved to main's version, the index
97+
# may now be clean (nothing to sync). Same guard as the no-conflict path.
98+
if git diff --cached --quiet; then
99+
echo "No changes to sync - auto-resolution kept main's version for everything."
100+
exit 0
101+
fi
102+
96103
git commit -m "chore: merge stable into main (release conflicts auto-resolved)"
97104
git push origin "$SYNC_BRANCH"
98105

0 commit comments

Comments
 (0)