From sentinel
Re-run failed GitHub Actions CI jobs for a PR. Detects failure type (build vs test) and reruns only failed jobs. Triggers on: make ci green, retry ci, rerun ci, fix ci, re-run failed jobs, retrigger ci.
How this skill is triggered — by the user, by Claude, or both
Slash command
/sentinel:make-ci-greenThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Re-run failed GitHub Actions CI jobs for a PR. Automatically detects the failure
Re-run failed GitHub Actions CI jobs for a PR. Automatically detects the failure type and reruns only the failed jobs within a workflow run.
gh CLI must be authenticated (gh auth status)--repo)Extract the PR number from the user's input. The PR number is required. Check
for --dry-run flag.
| User says | PR number |
|---|---|
/make-ci-green 482 | 482 |
| "retry ci for 482" | 482 |
| "make ci green on PR 482" | 482 |
| "re-run failed jobs 482 --dry-run" | 482 (dry run) |
Auto-detect the current repository from the git remote:
gh repo view --json nameWithOwner --jq '.nameWithOwner'
This gives you the OWNER/REPO needed for all subsequent commands.
Fetch the PR's head branch and find failed workflow runs:
# Get the PR branch name
PR_BRANCH=$(gh pr view <pr-number> --json headRefName --jq '.headRefName')
# List workflow runs for that branch, showing failed ones
gh run list --branch "$PR_BRANCH" --status failure --json databaseId,name,conclusion,event,headBranch,createdAt --limit 20
Also check for runs still in progress:
gh run list --branch "$PR_BRANCH" --status in_progress --json databaseId,name,conclusion,event,headBranch,createdAt --limit 10
For each failed run, get the job-level details to classify the failure:
gh run view <run-id> --json jobs --jq '.jobs[] | select(.conclusion == "failure") | {name, conclusion, steps: [.steps[] | select(.conclusion == "failure") | {name, conclusion}]}'
Classify each failure:
| Failed Step Pattern | Type | Rationale |
|---|---|---|
| checkout, setup, install, build, compile, configure, bootstrap, deps, cache | Build | Infrastructure/build failure |
| test, spec, check, lint, audit, storybook, e2e | Test | Test failure, likely flaky |
| Unknown | Unknown | Safe to retry |
Step matching is case-insensitive substring matching.
Show the user what was found:
Example output:
PR 482: 2 failed workflow run(s)
[FAILED] CI Tests (run 12345678)
Job: test-linux
Failed step: Run tests
Type: test failure (likely flaky)
[FAILED] Build (run 12345679)
Job: build-macos
Failed step: Compile project
Type: build failure
[IN PROGRESS] Lint (run 12345680)
Still running, skipping.
For test failures, pull the logs to identify specific failing tests:
gh run view <run-id> --log-failed 2>/dev/null | tail -200
From the logs, try to extract:
FAILED,
FAIL:, Error in, AssertionError, etc.)Present per-test analysis to the user when available.
If --dry-run, stop here after presenting findings.
Otherwise, ask the user to confirm, then rerun only the failed jobs:
gh run rerun <run-id> --failed
This reruns only the failed jobs within the run, not the entire workflow.
Report the results: which runs were retriggered, and provide links:
# Get the URL for the rerun
gh run view <run-id> --json url --jq '.url'
| Failed Step Keywords | Action | Rationale |
|---|---|---|
| checkout, setup, install, build, compile, configure, deps, cache, fetch | Rerun | Build/infra failure; retry may fix |
| test, spec, lint, audit, e2e, check | Rerun | Likely flaky; retry may pass |
| Unknown | Rerun | Safe default |
# Dry run: analyze without triggering
/make-ci-green 482 --dry-run
# Trigger reruns for all failing checks
/make-ci-green 482
# Natural language
"retry ci for PR 482"
"make ci green on 482"
--dry-run, present analysis and stop without triggering anything.gh run rerun --failed requires the run to have completed (not in progress)Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub luciferdono/sentinel