wait-for-ci

SKILL.md

Wait for CI (GitHub Actions)

When waiting for a GitHub Actions run to complete, use gh run watch with flags that minimise stdout and provide a checkable exit code. Do not run plain gh run watch <run-id>; it polls every 3 seconds and prints full pipeline status each time, which wastes context.

Command

gh run watch <run-id> --exit-status --compact
  • --exit-status: Exits with non-zero status if the run fails. Use the command’s exit code to decide success/failure.
  • --compact: Shows only relevant or failed steps instead of every step, reducing output size.

Optional: reduce poll frequency

To cut down output further, increase the refresh interval (default 3 seconds):

gh run watch <run-id> --exit-status --compact --interval 10

Checking the result

After the command exits:

  • Exit code 0 → run succeeded.
  • Non-zero exit code → run failed or was cancelled.

In shell scripts or when deciding next steps, rely on $? or the command in a conditional, e.g.:

gh run watch 12345 --exit-status --compact || echo "CI failed"

Getting a run ID

  • From the URL of a run: https://github.com/owner/repo/actions/runs/<run-id>.
  • From the CLI after a push: gh run list --limit 1 and use the run ID from the first row.
  • After gh pr create or gh pr checks: the run ID may be in the command output or from gh run list.

Repo in another repository

Use -R owner/repo when the run is not in the current repo:

gh run watch <run-id> --exit-status --compact -R owner/repo
Weekly Installs
7
First Seen
6 days ago
Installed on
gemini-cli7
github-copilot7
codex7
kimi-cli7
cursor7
opencode7