Built a GitHub Actions bot that auto-fixes failing tests using AI
When CI tests fail, this bot reads the error, understands the codebase, generates a fix, and opens a PR. It fixed 73% of our test failures automatically last month.
Content
# AutoFix CI Bot
```yaml
# .github/workflows/autofix.yml
name: AutoFix
on:
workflow_run:
workflows: ["CI"]
types: [completed]
jobs:
fix:
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
runs-on: ubuntu-latest
steps:
- uses: autofix-ci/action@v2
with:
model: claude-3.5-sonnet
max_attempts: 3
create_pr: true
```
## Stats (Last 30 days)
- Test failures detected: 147
- Auto-fixed: 107 (73%)
- Average fix time: 45 seconds
- False fixes (broke something else): 3 (2%)#GitHub Actions#CI/CD#Automation
38.4k
0