wait-ci

Waits for GitHub Actions workflow runs to complete in the background using run ID comparison.

Updated Dec 25, 2021
One-click install
npx skills add https://github.com/kotahashihama/dotfiles --skill wait-ci-kotahashihama
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wait-ci
Source: https://github.com/kotahashihama/dotfiles/tree/main/home/.claude/skills/wait-ci
Command: npx skills add https://github.com/kotahashihama/dotfiles --skill wait-ci-kotahashihama

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Polling for GitHub Actions completion often fails silently: checking only whether the latest run is completed can match an old, already-finished run, causing the process to exit immediately with stale results. This Skill waits correctly by distinguishing newly triggered runs from previous ones. ## Core Features & Use Cases - Run ID-based detection: Captures the previous run ID before triggering a workflow, then waits until a different run reaches completed status, avoiding false positives from old runs. - Event-aware filtering: Filters by workflow event (push, pull_request, issue_comment, workflow_dispatch) instead of branch, since slash-command-triggered runs report the base branch as headBranch. - Background waiting with result interpretation: Runs a single background polling loop and interprets the conclusion (success, failure, cancelled, skipped), classifying failures as code-related, approval-gated, or infrastructure issues. - Use Case: After pushing to a PR or triggering a workflow via a PR slash command, invoke this Skill to block until the new CI run finishes, then report the run ID, conclusion, and failure cause classification. ## Quick Start Wait for the GitHub Actions workflow I just triggered on this PR to finish and tell me the result and why it failed if it did.

Frequently Asked Questions about wait-ci

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I wait for a GitHub Actions workflow to finish from the command line?

Use gh run list with the workflow name and event filter in a polling loop, comparing the latest run ID against the run ID captured before triggering. Break the loop when a new run ID reaches completed status, then check its conclusion.

Why does my CI wait script exit immediately after triggering a workflow?

Checking only whether the latest run is completed matches an old, already-finished run, so the condition passes instantly. Capture the previous run ID before triggering and wait until a different run ID appears with completed status.

Why doesn't filtering gh run list by branch find runs triggered by PR comments?

Runs triggered by slash commands via issue_comment events report the base branch (e.g., main) as headBranch, not the feature branch. Filter by event type with --event issue_comment instead of --branch to reliably match these runs.

What does a skipped conclusion mean in GitHub Actions?

A skipped conclusion means the run was excluded by workflow conditions, such as configuration that skips draft PRs. Verify you are waiting for the correct workflow and event rather than treating it as a pass or failure.

Should I use timestamps to identify newly triggered workflow runs?

No. Time-based cutoffs fail due to clock skew and createdAt timestamp granularity, causing you to miss the target run and wait forever. Compare run database IDs instead, which uniquely identify each run.