CI Monitor
Watch GitHub Actions CI runs after a push. Auto-detects repo and branch, deduplicates concurrent monitors, reports results.
Usage
Run the script in the background after pushing:
uv run ~/.claude/skills/monitoring-ci/ci-monitor.py
With explicit branch:
uv run ~/.claude/skills/monitoring-ci/ci-monitor.py --branch my-feature
How to Invoke from Claude
After a push, resolve the HEAD SHA before launching the background command, then pass it via --sha:
# Get the SHA that was just pushed (jj or git)
SHA=$(jj log -r '@-' --no-graph -T 'commit_id' 2>/dev/null || git rev-parse HEAD)
# Run in background with SHA pinning
uv run ~/.claude/skills/monitoring-ci/ci-monitor.py --branch <branch-name> --sha "$SHA"
Use run_in_background: true so it doesn't block the conversation. Tell the user: "CI monitor running in background — you'll be notified when it completes."
IMPORTANT: Always pass --sha to avoid watching a stale run from a previous push. The monitor matches runs by SHA, so it will wait for the correct run to appear.
Features
- Auto-detects branch: jj bookmarks first, falls back to git
- Deduplicates: sentinel file at
/tmp/{repo}-ci-monitorprevents double-watching - Polls for run: waits up to 60s for a CI run to appear on the branch
- Watches until done: uses
gh run watch --exit-status - Reports failure logs: on failure, fetches
gh run view --log-failed(last 3000 chars) - Cleans up: always removes sentinel, even on error
Exit Codes
0— CI passed (or no run found)1— CI failed (logs printed)
Requirements
ghCLI authenticated- GitHub Actions workflows in the repo