Fix and Retry
Diagnose CI failure, fix it, and re-ship.
Steps
-
Diagnose: Follow the
diagnose-ciworkflow:gh run list --status=failure --limit 1 --json databaseId,name,headBranchto find the latest failuregh run view <id> --log-failedto get error logs- Identify root cause and affected files
-
Fix: Apply the fix to the codebase. Read the affected file(s), make the edit, and verify the fix makes sense.
-
Commit: Create a conventional commit for the fix (e.g.,
fix(ci): correct workflow syntax). Use a HEREDOC for the message. -
Push:
git push -
Watch: Poll
gh run list --branch $(git branch --show-current) --limit 1 --json databaseId,status,conclusionevery 15s (max 5 minutes) until the run completes. -
Report: Show whether the re-run passed or failed. If it failed again, show the new error.
Rules
- Only fix issues you can confidently diagnose from the logs. If the cause is unclear, report the diagnosis and ask the user rather than guessing.
- Never force push or amend the previous commit.
- If the fix requires secrets, env vars, or manual GitHub settings changes, explain what’s needed instead of attempting it.