원클릭으로
fix-failing-actions
Analyze and fix failing GitHub Actions CI/CD for the current branch. Fetches failures, diagnoses root causes, applies fixes, pushes, and watches until green.
메뉴
Analyze and fix failing GitHub Actions CI/CD for the current branch. Fetches failures, diagnoses root causes, applies fixes, pushes, and watches until green.
| name | fix-failing-actions |
| description | Analyze and fix failing GitHub Actions CI/CD for the current branch. Fetches failures, diagnoses root causes, applies fixes, pushes, and watches until green. |
| license | MIT |
| compatibility | Requires git, gh (GitHub CLI), and Node.js installed. |
| allowed-tools | Bash(npx agent-actions-review *) Bash(pnpm dlx agent-actions-review *) Bash(yarn dlx agent-actions-review *) Bash(bunx agent-actions-review *) Bash(git config *) Bash(git add *) Bash(git commit *) Bash(git push *) Bash(npm run *) Bash(npx *) Bash(pnpm run *) Bash(yarn run *) Bash(bun run *) Read Edit Write Grep Glob |
| metadata | {"author":"petems","version":"0.1.4","homepage":"https://github.com/petems/agent-actions-review"} |
Automatically diagnose and fix failing GitHub Actions workflows on the current branch. Uses a two-phase workflow: fix all existing failures, then poll until all checks pass green.
Inspired by pbakaus/agent-reviews which does the same for PR review comments.
All commands below use npx agent-actions-review. If the project uses a different package manager, substitute the appropriate runner (e.g., pnpm dlx agent-actions-review for pnpm, yarn dlx agent-actions-review for Yarn, bunx agent-actions-review for Bun). Honor the user's package manager preference throughout.
Cloud environments only (e.g., Codespaces, remote agents): verify git author identity so CI checks can map commits to the user. Run git config --global --get user.email and if empty or a placeholder, set it manually. Skip this check in local environments.
Run npx agent-actions-review list --status failure --json
The CLI auto-detects the current branch, finds associated workflow runs, and authenticates via gh CLI or environment variables. If anything fails (no token, no repo, CLI not installed), it exits with a clear error message.
If zero failing runs are returned, check for in-progress runs:
npx agent-actions-review list --status in_progress --json
If everything is green, print "All checks passing" and exit.
For each failing run, get the detailed breakdown:
Run npx agent-actions-review detail <run_id> --json
This returns:
For tighter output, add --failures-only to skip the full jobs list and return only { run, failures } (faster triage), or --logs-only to get just a flat [{ job, step, errors, tail }] array of log excerpts. Both require --json; --logs-only takes precedence if both are passed.
For each failure from the detail output:
Use the automatic category field as a starting point, then read the log errors and referenced code to determine:
Likely FIXABLE:
Likely FLAKY:
Likely INFRA:
When UNKNOWN, ask the user:
If FIXABLE: Read the relevant source code. Apply the fix. Track the run ID and a brief description.
If FLAKY: Re-run the workflow:
Run npx agent-actions-review rerun <run_id>
Track as re-run.
If INFRA: Report to the user. Cannot fix from code.
If UNKNOWN: Ask the user. If they say skip, track it as skipped.
Do NOT watch yet. Watching happens after all fixes are committed (Step 5).
After processing ALL failing runs:
Run the project's lint and type-check if applicable
Stage, commit, and push:
git add -A
git commit -m "fix: resolve CI failures
{List of fixes applied, grouped by workflow}"
git push
Capture the commit hash from the output.
Run npx agent-actions-review watch --json
This polls until all workflow runs pass green or times out.
After the watch command completes, check the output:
If all passing (allPassing: true): Move to the Summary Report.
If timed out with failures (timedOut: true):
npx agent-actions-review list --status failure --json to get current failuresRepeat until all checks pass or the user intervenes. Keep diagnosing, fixing, pushing, and watching as long as new actionable failures appear. Track each cycle's failures by comparing the error message, file path, and line number. If the set of failures is identical across two consecutive cycles, stop and ask the user for guidance rather than retrying the same fix. As a fallback safety net, stop after 10 cycles maximum even if failures are still changing.
After all phases complete, provide a summary:
## CI/CD Fix Summary
### Results
- Fixed: X issues
- Re-run (flaky): X workflows
- Infra issues: X (reported)
- Skipped: X
### By Workflow
#### build-and-test
- Test failure in src/utils.test.js: fixed assertion - Fixed in abc1234
- Lint error in src/index.js: missing semicolon - Fixed in abc1234
#### deploy-preview
- Flaky timeout in deploy step - Re-run triggered
### Status
All checks passing. CI is green.