Skip to content

ci(sync-patches): guard conflict-resolution path against empty commits#3124

Merged
caio-pizzol merged 1 commit intomainfrom
caio/fix-sync-patches-noop-guard
May 4, 2026
Merged

ci(sync-patches): guard conflict-resolution path against empty commits#3124
caio-pizzol merged 1 commit intomainfrom
caio/fix-sync-patches-noop-guard

Conversation

@caio-pizzol
Copy link
Copy Markdown
Contributor

The sync-patches workflow has two paths for merging stable into main: a clean-merge path and a conflict-resolution path. Both eventually call git commit. The clean-merge path checks git diff --cached --quiet first and exits early if nothing is staged, but the conflict-resolution path doesn't.

That gap surfaced after PR #3123 merged: the only conflicts were release-managed files (package.json versions, etc.), all auto-resolved to main's version, leaving the index clean. The bare git commit then exited 1 and the run went red, even though stable and main were correctly in sync (run https://github.com/superdoc-dev/superdoc/actions/runs/25338598551).

This adds the same early-exit guard to the conflict-resolution path. No behavior change when there's actually content to sync.

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.
@caio-pizzol caio-pizzol requested a review from a team as a code owner May 4, 2026 19:25
@caio-pizzol caio-pizzol merged commit 6b115f1 into main May 4, 2026
14 of 15 checks passed
@caio-pizzol caio-pizzol deleted the caio/fix-sync-patches-noop-guard branch May 4, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant