Monitor GitHub Actions for failures. Auto-fix what's fixable, report what's not.
scripts/check-ci-failures.sh polls repos for new failed runsgh run view --logbash scripts/check-ci-failures.sh
Output: OK (no failures) or FAILURES with details.
Set up a cron that runs every 30 minutes:
bash scripts/check-ci-failures.shEnvironment variables:
GITHUB_OWNER — GitHub username (auto-detected from gh if not set)CI_REPOS — Space-separated repo names (auto-discovers all repos if not set)CI_STATE_FILE — Path to state JSON (tracks last check time)| Pattern | Detection | Fix |
|---|---|---|
| --------- | ----------- | ----- |
| Dependency issues | npm ERR! Could not resolve | npm install + push |
| Test snapshots | Snapshot mismatch | npm test -- --update + push |
| Lint errors | eslint, Formatting | eslint --fix + push |
| E2E snapshots | Playwright snapshot diff | playwright --update-snapshots + push |
Read references/fix-patterns.md for detailed decision tree, log reading commands, and all known patterns with fix scripts.
# Latest failed run logs
gh run view --repo OWNER/REPO --log 2>&1 | tail -50
# Filter for errors
gh run view <run-id> --repo OWNER/REPO --log 2>&1 | grep -A5 "error\|FAIL"
Always verify the fix worked:
sleep 90 # Wait for new CI run
gh run list --repo OWNER/REPO --limit 1 --json conclusion -q '.[0].conclusion'
# Should be "success"
共 1 个版本