AI-powered merge conflict resolver for GitHub Actions
Automatically resolves git merge conflicts using Claude, OpenAI, or local Ollama — so your CI doesn't stall on conflicts.
- name: Resolve merge conflicts
uses: faw21/mergefix-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}name: Auto-resolve conflicts
on:
pull_request:
types: [opened, synchronize]
jobs:
resolve-conflicts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Resolve merge conflicts
id: mergefix
uses: faw21/mergefix-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
commit_fixes: 'true'
commit_message: 'fix: auto-resolve merge conflicts'
- name: Report result
run: |
echo "Resolved: ${{ steps.mergefix.outputs.resolved }}"
echo "Conflicts: ${{ steps.mergefix.outputs.conflict_count }}"| Input | Description | Default |
|---|---|---|
anthropic_api_key |
Anthropic API key (Claude) | '' |
openai_api_key |
OpenAI API key | '' |
provider |
LLM provider: claude, openai, or ollama |
claude |
model |
Model override (uses provider default if empty) | '' |
files |
Space-separated files to resolve (auto-detects if empty) | '' |
dry_run |
Show resolutions without writing | false |
commit_fixes |
Commit resolved files to the branch | false |
commit_message |
Commit message for resolved conflicts | fix: resolve merge conflicts with mergefix |
github_token |
GitHub token (needed for commit_fixes) |
${{ github.token }} |
| Output | Description |
|---|---|
resolved |
true if all conflicts were resolved |
conflict_count |
Number of conflict blocks resolved |
- uses: faw21/mergefix-action@v1
with:
provider: ollama
model: qwen2.5:1.5bNote: Ollama must be running in the same job. See ollama-action for setup.
MIT