brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: gh pr checks can watch a pull request and stop at the first failing check

CLI
~/tips/tip-cli-gh-pr-checks-watch

gh pr checks --watch --fail-fast

Watches the checks of a pull request and quits as soon as one fails.

A pull request can have a dozen checks, and the one that matters often fails in the first minute while the rest keep running. You don’t have to wait for all of them.

On the branch of the pull request, run:

gh pr checks --watch --fail-fast

Without an argument it picks the pull request of the current branch. --watch keeps refreshing the list until the checks finish, every 10 seconds unless you change it with -i. --fail-fast stops watching the moment any check fails, so you can open the log and fix it while the others are still busy.

Add --required to look only at the checks that block merging, which hides optional linters and preview builds:

gh pr checks 123 --watch --required

The exit code tells a script what happened: 0 when everything passed, 1 when something failed, and, without --watch, 8 when checks are still pending. I’d keep that last one for a loop on a slow machine where watching is overkill.

Watching stops only when every check reaches an end state. A check stuck in queued, for example because no runner is free, keeps it going for a long time. If that happens, Ctrl-C and look at the queue in the web page. --json with the bucket field gives pass, fail or pending per check if you’d rather parse it.

Further reading: gh pr checks (GitHub CLI manual)

Going deeper: Moving on from hdtv: how to export your TV show list to Trakt.tv

More CLI tips printf 'GET /\r\n' | hexdump -C hexdump -C -s 512 -n 64 disk.img wget --limit-rate=2m https://example.com/big-file.iso wget --spider https://example.com/file.zip rg 'apiKey' -g '!*.min.js' -g '!package-lock.json' All CLI tips (46) All topics

Link