Analyze GitHub Actions CI failures for the current branch...
Analyzes GitHub Actions CI failures for the current git branch and provides detailed failure reports.
When the user asks about CI status, failures, or test errors, follow these steps:
git rev-parse --abbrev-ref HEAD
gh run list --branch <branch-name> --limit 5
This shows the most recent workflow runs with their status (completed/success/failure).
Look for runs with failure status in the output. Get the run ID (first column).
gh run view <run-id> --log-failed
This shows only the failed job logs, filtering out successful steps.
Parse the logs to find:
Use grep to find error patterns:
gh run view <run-id> --log | grep -A 20 "FAILED"
gh run view <run-id> --log | grep -B 5 -A 30 "ERRORS\|FAILURES"
gh run view <run-id> --log | grep -A 100 "ModuleNotFoundError\|ImportError\|AssertionError"
Format the report as:
## CI Status for branch: <branch-name>
**Most recent run:** <status> (run ID: <run-id>)
### Failure Summary
- **Failed tests:** List of failed test names
- **Total results:** X failed, Y passed, Z skipped
- **Error type:** ModuleNotFoundError / AssertionError / etc.
### Root Cause
Clear explanation of what went wrong
### Failed Test Details
For each failed test:
- Test file and function name
- Error message
- Relevant stack trace excerpt
gh run list --branch to get the current branch status--log-failed first for concise output--log with grepUser asks: "Check the CI status"
You should:
git rev-parse --abbrev-ref HEADgh run list --branch <branch> --limit 5gh run view <run-id> --log-failedUser asks: "Why did the tests fail?"
You should: