mcpField
W
watch-ci

watch-ci

github.com/codervisorCloud & DevOps30040 installsUpdated 23w ago
Repository

About watch-ci

A skill for monitoring GitHub Actions CI on the current HEAD commit in the codervisor/leanspec repository. It uses GitHub’s REST API with curl, locates the exact commit’s run, polls jobs, and retrieves failure logs.

Key features

  1. 01Match workflow runs by commit SHA
  2. 02Poll job status until completion
  3. 03Retrieve logs for failed jobs
  4. 04Report overall and per-job results

Use cases

  1. 01Track CI for the current branch commit
  2. 02Wait for Node.js and Rust jobs to finish
  3. 03Inspect failing job steps and logs

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/codervisor/leanspec --skill watch-ci

After installing, type/watch-ciin Claude Code to confirm it loaded.

Details

From the project README

Watch CI

Poll the GitHub Actions CI pipeline for the current HEAD commit until all jobs finish.

Environment

The gh CLI is not available in the Claude VM. Use the GitHub REST API via curl. The repo is codervisor/leanspec.

Steps

  1. Get the current commit SHA and branch:

    SHA=$(git rev-parse HEAD)
    BRANCH=$(git branch --show-current)
    echo "Watching CI for commit $SHA on branch $BRANCH"
    
  2. Find the workflow run matching our exact commit. The API returns runs newest-first; filter by head_sha. If the run hasn't appeared yet (GitHub can take a few seconds), retry up to 5 times with 10s waits:

    curl -sH "Accept: application/vnd.github+json" \
      "https://api.github.com/repos/codervisor/lean-spec/actions/runs?branch=$BRANCH&head_sha=$SHA&per_page=1" \
      | python3 -c "
    import json, sys
    data = json.load(sys.stdin)
    runs = data.get('workflow_runs', [])
    if not runs:
        print('NO_RUNS'); sys.exit()
    r = runs[0]
    print(f'RUN_ID={r[\"id\"]}')
    print(f'Status: {r[\"status\"]}  Conclusion: {r.get(\"conclusion\") or \"pending\"}  Commit: {r[\"head_sha\"][:8]}')"
    
  3. Poll jobs until all complete (every 60s for Rust builds which take ~8-10 min):

    curl -sH "Accept: application/vnd.github+json" \
      "https://api.github.com/repos/codervisor/lean-spec/actions/runs/$RUN_ID/jobs" \
      | python3 -c "
    import json, sys
    data = json.load(sys.stdin)
    for j in data.get('jobs', []):
        steps = [s for s in j.get('steps', []) if s['status'] == 'in_progress']
        step_info = f' -> {steps[0][\"name\"]}' if steps else ''
        print(f'{j[\"name\"]:40}  {j[\"status\"]:12}  {j.get(\"conclusion\") or \"\"}{step_info}')"
    
  4. On failure, fetch the failed job logs to diagnose:

    curl -sH "Accept: application/vnd.github+json" \
      "https://api.github.com/repos/codervisor/lean-spec/actions/runs/$RUN_ID/jobs" \
      | python3 -c "
    import json, sys
    data = json.load(sys.stdin)
    for j in data.get('jobs', []):
        if j.get('conclusion') == 'failure':
            print(f'FAILED: {j[\"name\"]} (id: {j[\"id\"]})')
            for s in j.get('steps', []):
                if s.get('conclusion') == 'failure':
                    print(f'  Step: {s[\"name\"]}')"
    

CI Structure

  • node (~2 min): pnpm install, build, typecheck, test
  • rust (~8-10 min, depends on node): cargo fmt, clippy, build, test, TS binding export

Reporting

Give the user a brief status update each poll cycle. On completion, summarize:

  • Overall result (success/failure)
  • Per-job results
  • If failed: which step failed and relevant error output

Comments

Markdown supported