feat: add --output-merge-conflicts flag for CI/CD#1903
Open
Conversation
…t conflicts When persistent edits (custom code) encounters merge conflicts during CI/CD, the CLI previously errored out requiring local resolution. With the new --output-merge-conflicts flag, the CLI writes files with conflict markers, resolves the git conflict state (so files are committable), logs a warning, and exits successfully so the GitHub Action can commit conflicted files to a PR for the developer to resolve. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
--output-merge-conflictsflag tospeakeasy runthat writes merge conflict markers to files and continues instead of failing when persistent edit conflicts are detected::warningannotations (instead of::error) for GitHub ActionsDetails
Problem: During CI/CD, when persistent edits (custom code) encounter merge conflicts, the CLI errors out and tells the user to resolve conflicts locally. This prevents the GitHub Action from committing the changes.
Solution: With
--output-merge-conflicts, the CLI:ResolveConflictState)Files changed:
cmd/run.goOutputMergeConflictsflag and thread to workflow optsinternal/run/workflow.goWithOutputMergeConflictsopt funcinternal/run/target.goGenerateOptionsinternal/sdkgen/sdkgen.gorenderConflictsWarning, adjust success messageinternal/git/plumbing.goResolveConflictState(go-git + native git paths)Test plan
--output-merge-conflictsagainst a known conflict scenario:git statusshows modified (not conflicted) files🤖 Generated with Claude Code