Repository navigation
fix: sync-main-to-dev conflict detection with merge-tree - #412
Merged
c-vigo merged 1 commit intoMar 22, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes false-positive merge conflict detection in the sync-main-to-dev GitHub Actions workflow by switching from a working-tree git merge check (with stderr suppressed) to an in-memory git merge-tree --write-tree check with explicit exit-code handling. This aligns sync PR labeling/title/auto-merge behavior with GitHub’s actual mergeability state and avoids mislabeling on unrelated failures.
Changes:
- Replace trial working-tree
git mergeconflict detection withgit merge-tree --write-tree, treating exit code1as conflicts and other failures as fatal. - Apply the same logic to the workspace template copy of the workflow.
- Add a changelog entry documenting the fix (and sync it into the workspace
.devcontainerchangelog).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.github/workflows/sync-main-to-dev.yml |
Uses git merge-tree --write-tree for conflict detection; distinguishes conflicts vs unexpected errors to prevent false merge-conflict labeling and skipped auto-merge. |
assets/workspace/.github/workflows/sync-main-to-dev.yml |
Mirrors the updated merge-tree-based conflict detection logic in the workspace template workflow. |
CHANGELOG.md |
Documents the fix under the 0.3.1 “Fixed” section with issue reference. |
assets/workspace/.devcontainer/CHANGELOG.md |
Syncs the same changelog entry into the workspace devcontainer template. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes false-positive merge conflict detection in
sync-main-to-dev: the workflow used a working-treegit mergewith stderr discarded, so any non-zero exit was treated as conflicts. Sync PRs were mislabeledmerge-conflict, titles got(conflicts), and auto-merge was skipped even when GitHub reported a clean merge.Replaces that with
git merge-tree --write-tree origin/dev origin/main(in-memory, same merge semantics asgit merge), distinguishes exit 1 (real conflicts) from other failures, and fails the step on unexpected errors instead of mislabeling.Type of Change
feat-- New featurefix-- Bug fixdocs-- Documentation onlychore-- Maintenance task (deps, config, etc.)refactor-- Code restructuring (no behavior change)test-- Adding or updating testsci-- CI/CD pipeline changesbuild-- Build system or dependency changesrevert-- Reverts a previous commitstyle-- Code style (formatting, whitespace)Modifiers
!) -- This change breaks backward compatibilityChanges Made
.github/workflows/sync-main-to-dev.ymlgit merge+merge --abortwithgit fetch origin main devandgit merge-tree --write-tree; setconflictoutput from exit code; log/warn/error accordinglyassets/workspace/.github/workflows/sync-main-to-dev.ymlCHANGELOG.md## [0.3.1] - TBDassets/workspace/.devcontainer/CHANGELOG.mdCHANGELOG.mdvia manifest (pre-commit)Changelog Entry
This PR targets
release/0.3.1; the entry is under## [0.3.1] - TBD→### Fixed(not## Unreleased):Testing
just test)Manual Testing Details
N/A — workflow-only change; verify on next
sync-main-to-devrun (clean merge → auto-merge enabled, no falsemerge-conflictlabel).Checklist
docs/templates/, then runjust docs)CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
Release branch: changelog entry is under
## [0.3.1] - TBD→### Fixed(not## Unreleased), per project changelog rules.Downstream
devcontainer-smoke-testkeeps a decoupled copy of this workflow; align it on the next template sync or a follow-up PR there.Refs: #410