3.9 KiB
3.9 KiB
description, argument-hint, allowed-tools
| description | argument-hint | allowed-tools | |
|---|---|---|---|
| Summarize the latest GitHub Actions runs, surface results, and analyze issues. |
|
Edit, Bash, Grep, Read |
Goal
Pull the most recent GitHub Actions workflow runs for a repo, summarize their status, and analyze failures with actionable diagnostics and next steps.
Inputs
$ARGUMENTScan be:- Optional flags:
workflow=<file|id>|all(e.g.,workflow=ci.ymlorworkflow=all; default: all workflows)
- Optional flags:
Plan
-
Resolve repository coordinates
- You usually know what the current owner/repo are (often repo is the folder name).
- If
owner/repois unclear, infer from local git:- Verify repo: !
git rev-parse --is-inside-work-tree - Remote URL: !
git remote get-url origin || git config --get remote.origin.url - Parse
ownerandrepofromhttps://github.com/owner/repo(.git)?orgit@github.com:owner/repo(.git)?.
- Verify repo: !
- Find out and remember the current commit SHA using
git rev-parse HEAD.
-
Select workflows
- If
workflownot provided or set toall, usegh workflow listto enumerate available workflows. - When calling
/flow:cinext time, remember what those workflows are; no need to repeat unless explicitly prompted. - Otherwise, constrain to the specified workflow file name or numeric ID.
- If
-
Fetch latest runs
- For each selected workflow, use
gh run list --workflow=<workflow> --limit=<count> --json databaseId,headSha,status,conclusion,event,createdAt,updatedAt,url,namewith filters:--branch=<branch>if provided--limit=<count>(default 3, max 20)
- For each run returned, check if it refers to the current commit SHA.
- For each that does and that is completed, use
gh run view <run-id> --json status,conclusion,createdAt,updatedAt,url,event,jobsto get more info:- Capture status, conclusion, timings, HTML URL, job details
- If for a given workflow the run for the current commit has not yet completed, remember that but also examine the most recent completed run.
- For each selected workflow, use
-
Deep-dive on failures
- For any run that has completed but with
conclusionnotsuccess:- Use
gh run view <run-id> --log-failedto get logs for failed jobs. - Extract dominant error patterns (stack traces, test failures, exit codes, missing secrets, flaky steps, infra timeouts).
- Map failing jobs to workflow graph where possible; note common failing steps across runs.
- Use
- For any run that has completed but with
-
Produce report
- Show commit SHA prominently in the header as well as whether all runs for this commit succeeded, some failed or are still ongoing.
- Overview table (per workflow): run ID → commit SHA, status, conclusion, event, duration, started, link.
- Again, show the runs for the current commit, except if they are not complete, in which case also show the most revent completed run.
- Failure summary: frequency by job/step, top error signatures, first-seen vs. most-recent.
- Root-cause hypotheses per failure cluster, with concrete next actions:
- config fixes (matrix keys, permissions, cache keys)
- environment/toolchain diffs (runner image, Node/Java versions)
- flaky tests (test names, suggested quarantine patterns)
- secret/permission issues (missing
GITHUB_TOKENscopes, OIDC, org secret visibility)
- Appendix: tailed logs for failed jobs
-
Output
- Show this to the user
Execution details
- Prefer read-only operations; do not cancel or rerun jobs in this command.
- Be resilient to:
- Missing workflows (empty list)
- Private repos or insufficient PAT scopes (report and stop gracefully)
- Very large logs (use appropriate filtering)
- If
ghCLI is not authenticated or configured, inform the user to rungh auth loginfirst.
Now do it
- Gather data using the
ghCLI commands listed above. - Analyze failures and suggest possible steps to mitigate.
- Present the report to the user in the nice visual format.