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 run rerun can retry only the jobs that failed

CLI
~/tips/tip-cli-gh-run-rerun-failed

gh run rerun 1234567890 --failed

Reruns the failed jobs of a workflow run instead of the whole run.

One flaky test job fails, nine others passed. Rerunning everything wastes minutes and runner time.

Find the run, then rerun only what failed:

gh run list --status failure --limit 5
gh run rerun 1234567890 --failed

--failed reruns the failed jobs plus the jobs they depend on, so the outputs they need are there again. Add --debug to turn on debug logging for the rerun, which is the quickest way to get more detail on a failure you can’t reproduce.

To rerun a single job, use -j with the job’s ID. The help warns that the number in the browser URL of a job is not that ID. Get the right one like this:

gh run view 1234567890 --json jobs --jq '.jobs[] | {name, databaseId}'

I’d pair it with gh run watch so you see the rerun finish without switching windows.

A rerun uses the same commit and the same workflow file as the original run. If you fixed the workflow or the code, push a new commit instead, because a rerun will happily fail the same way. And if the run is older than the retention window, GitHub may refuse to rerun it at all.

Further reading: gh run rerun (GitHub CLI manual), gh run view (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