Quick overview
Triage failed GitHub Actions runs with history, rerun rules, and human review. Logs, signatures, and past runs decide defect, flaky, or infrastructure, then open an issue, rerun once, or notify a human.
How it works
- Triggers on a GitHub Actions workflow_run webhook, on an hourly schedule sweep, or via a manual trigger to start triage.
- Normalizes and validates the incoming event, and skips runs that are not completed or are missing required repository/run details.
- If the run succeeded, appends a “passing” record to Google Sheets (FailureHistory) and returns a log-only result.
- For a failed run (or a sweep-selected untriaged failure), fetches the run’s jobs from the GitHub API, downloads the failed job logs, and extracts a normalized error signature and evidence lines.
- Loads FailureHistory, VerdictLog, and RerunLog from Google Sheets plus recent GitHub runs, changed files, and open GitHub issues to score repetition, detect duplicates, and add context.
- Requests a suggested fix from the Google Gemini API and applies deterministic rules (history counts, rerun budget, cooldown, and infrastructure patterns) to decide between creating an issue, rerunning failed jobs, or routing to human review.
- Logs the verdict to Google Sheets and then either creates a GitHub issue and posts a Slack alert, triggers a GitHub “rerun failed jobs”, or posts to Slack and emails via Gmail for human review.
Setup
- Create a Google Sheet with tabs named FailureHistory, VerdictLog, and RerunLog, then paste its spreadsheet ID into the workflow configuration.
- Add a GitHub API credential (Authorization header token with repo and Actions permissions) and attach it to the GitHub HTTP Request steps.
- Add Google Sheets OAuth credentials, a Slack credential (and set the target channel ID), and a Gmail OAuth credential for sending human-review emails.
- Add a Google Gemini API key and confirm the model name in the workflow configuration.
- Configure a GitHub webhook for workflow_run events to POST to the workflow’s webhook URL (path: /ci-triage) and update repo owner/name, thresholds, and rerun limits in the configuration values.