tea-ci-watch.sh could exit 0 as soon as one CI workflow finished when several run on the same commit.
Gitea only posts an Actions job's commit status once a runner picks the job up, so queued workflows are invisible to the combined status API. Example from color-tool PR #13: Test PR succeeded at 05:00:44, but Auto Label's first (pending) status wasn't posted until 05:01:11. In between, the combined status read success with 1 check.
Fix
Also poll GET /repos/{repo}/actions/runs?head_sha=<sha>, which lists runs from the moment they're triggered, queued included.
Success only when no run is waiting/queued/in progress and the combined status is success/warning. If every job was skipped (completed runs, zero statuses), that also counts as success.
Fail fast (exit 1) on a failed/errored status or a failed/cancelled run; both are printed.
"No CI" (exit 3) now also requires zero runs.
ship-it bumped to 1.2.1, dist/ regenerated, README now documents all four ship-it phases.
Verification
Live (Gitea 1.27.3):
color-tool two-workflow commit: exit 0
qmk_firmware failed lint: exit 1, failures printed from both checks
repo that doesn't exist: exit 2
Stub tea replaying the race (one check done, second workflow queued with no status): waits through the queued window, exits 0 only after the second workflow finishes.
Stub runs of the all-skipped case (exit 0) and the no-CI case (exit 3) also passed.
## Problem
`tea-ci-watch.sh` could exit 0 as soon as **one** CI workflow finished when several run on the same commit.
Gitea only posts an Actions job's commit status once a runner picks the job up, so queued workflows are invisible to the combined status API. Example from color-tool PR #13: `Test PR` succeeded at 05:00:44, but `Auto Label`'s first (pending) status wasn't posted until 05:01:11. In between, the combined status read `success` with 1 check.
## Fix
- Also poll `GET /repos/{repo}/actions/runs?head_sha=<sha>`, which lists runs from the moment they're triggered, queued included.
- Success only when no run is waiting/queued/in progress **and** the combined status is `success`/`warning`. If every job was skipped (completed runs, zero statuses), that also counts as success.
- Fail fast (exit 1) on a failed/errored status or a failed/cancelled run; both are printed.
- "No CI" (exit 3) now also requires zero runs.
- ship-it bumped to 1.2.1, `dist/` regenerated, README now documents all four ship-it phases.
## Verification
- Live (Gitea 1.27.3):
- color-tool two-workflow commit: exit 0
- qmk_firmware failed lint: exit 1, failures printed from both checks
- repo that doesn't exist: exit 2
- Stub `tea` replaying the race (one check done, second workflow queued with no status): waits through the queued window, exits 0 only after the second workflow finishes.
- Stub runs of the all-skipped case (exit 0) and the no-CI case (exit 3) also passed.
- `bash -n` and `shellcheck` are clean.
https://claude.ai/code/session_011atyN7HD7xfX6Fn9926J9f
Gitea only posts an Actions job's commit status once a runner picks the
job up, so queued workflows were invisible to the combined status. With
multiple workflows on a commit, the watcher returned success as soon as
the first one finished.
Also poll the Actions runs API (head_sha filter), which lists runs from
the moment they are triggered. Succeed only when no run is pending and
the combined status is terminal; fail fast on failed/cancelled runs or
failed statuses. Bump ship-it to 1.2.1 and document the CI phases in
the README.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
tea-ci-watch.shcould exit 0 as soon as one CI workflow finished when several run on the same commit.Gitea only posts an Actions job's commit status once a runner picks the job up, so queued workflows are invisible to the combined status API. Example from color-tool PR #13:
Test PRsucceeded at 05:00:44, butAuto Label's first (pending) status wasn't posted until 05:01:11. In between, the combined status readsuccesswith 1 check.Fix
GET /repos/{repo}/actions/runs?head_sha=<sha>, which lists runs from the moment they're triggered, queued included.success/warning. If every job was skipped (completed runs, zero statuses), that also counts as success.dist/regenerated, README now documents all four ship-it phases.Verification
teareplaying the race (one check done, second workflow queued with no status): waits through the queued window, exits 0 only after the second workflow finishes.bash -nandshellcheckare clean.https://claude.ai/code/session_011atyN7HD7xfX6Fn9926J9f