🤖 GitHub Issue Auto-Fix Workflow

Automated code review and fix pipeline powered by OpenClaw

Bot Automated
Human Action
Decision Gate
GitHub/API
🤖
Phase 1: Bot Steps (Automated)
1 Poll GitHub Issues
Fetch open issues from the repository at regular intervals
API: GET /repos/{owner}/{repo}/issues
Filter: state=open, labels={label}
2 Filter & Prioritize
Filter issues by label, assignee, and milestone
Filters: label=bug, assignee=@me
Excludes: already-processed issues
3 Confidence Check
Analyze issue for fixability before attempting
LOW Score < 7: Skip with reason logged
HIGH Score ≥ 7: Proceed to implementation
4 Create Branch
Create a feature branch for the fix
Branch: fix/issue-{number}
From: {base_branch} (usually main)
5 Implement Fix
Analyze code, locate bug, implement solution
• Search codebase for relevant files
• Read and understand context
• Make minimal, focused changes
• Follow existing code style
6 Run Tests
Execute test suite to verify fix doesn't break anything
FAIL Retry fix (max 2 attempts)
PASS Proceed to commit
7 Commit & Push
Stage changes, commit, and push to fork
git add .
git commit -m "fix: {short description}"
git push -u fork fix/issue-{N}
8 Create Pull Request
Open a PR from fork to source repository
API: POST /repos/{owner}/{repo}/pulls
Head: {fork}:fix/issue-{N}
Base: {base_branch}
9 Notify User
Send notification with PR details
Channel: Discord/Telegram
Message: PR URL, files changed, summary
↓
👤
Phase 2: Human Steps (Manual)
10 Review & Test Locally
Human reviews the PR and tests the fix
• Check PR diff on GitHub
• Pull branch and test locally
• Verify fix resolves the issue
• Check code quality
11 Approve or Reject
Decision on whether to merge the PR
👎 REJECT Close PR without merging
👍 APPROVE Proceed to merge
12 Merge Pull Request
Squash and merge the PR into main branch
API: PUT /repos/{owner}/{repo}/pulls/{N}/merge
Method: squash
Delete branch: yes
↓
🛡️
Phase 3: Post-Merge Safety (Automated)
13 Monitor CI (24hr)
Watch for CI failures after merge
• Poll CI status on main branch
• Check for test failures
• Monitor for regressions
14 CI Status Check
Did the merged code pass all CI checks?
FAIL Auto-create revert PR
PASS Cleanup and continue
15 Auto-Revert (if needed)
Automatically revert if CI fails post-merge
• Create revert commit
• Open revert PR
• Notify user immediately
16 Cleanup
Remove branches and update tracking
• Delete merged branch
• Update processed issues list
• Reset for next cycle

⏱️ Timing Configuration

30 min
Poll Interval
60 min
Bot Timeout
1 hr
Cool-off Period
24 hr
Post-Merge Monitor

🚀 Start the Workflow

/gh-issues owner/repo --label bug --fork your-fork/repo --watch --cron --interval 30 --yes
🔒 Fork-based (safe)
📊 Confidence scoring
🔄 Auto-retry on fail
🛡️ Auto-revert on CI fail