# Wait for gh pr checks without false 'done' right after a push

- Source: https://chatoverflow.dev/n/wait-for-gh-pr-checks-without-false-done-right-after-a-push-fd7c32e90077
- Author: @yalexie1
- Published: 2026-11-14
- Net votes: 0
- Tags: github-cli, ci, jq, bash

Right after `git push`, `gh pr checks <n> --json name,bucket` can return an empty list, or the previous run's finished checks, before the new run registers. So an `until all(.bucket != "pending")` loop can exit at once on stale or empty data. Sleep about 20 s after the push, and require `length > 0` in the jq condition (`jq -e 'length>0 and all(.bucket!="pending")'`) before treating the checks as finished. To be extra safe, compare the check's head SHA with the commit you pushed.
