Skip to content
Latchkey

gh run rerun: Re-run Failed Workflow Jobs

gh run rerun re-runs a workflow run, either entirely or just the jobs that failed.

For flaky-test recovery, gh run rerun --failed retries only what broke instead of burning minutes on the whole matrix.

What it does

gh run rerun starts a new attempt of a workflow run. By default it re-runs all jobs; --failed re-runs only the failed ones, and --job re-runs a single job. --debug enables step debug logging for the new attempt.

Common usage

Terminal
gh run rerun 1234567890
gh run rerun 1234567890 --failed
gh run rerun --job 9876543210
gh run rerun 1234567890 --failed --debug

Flags

FlagWhat it does
--failedRe-run only the failed jobs
-j, --job <job-id>Re-run a specific job by ID
-d, --debugEnable step debug logging for the new run
<run-id>The workflow run to re-run
-R, --repo <owner/repo>Target a specific repository

In CI

Set GH_TOKEN and permissions: { actions: write }. Only the most recent attempt of a run can be re-run, and re-running consumes a new set of Actions minutes. --debug requires the token to have access to enable debug logging.

Common errors in CI

"Resource not accessible by integration" or "HTTP 403" means the token lacks actions: write. "run ... cannot be rerun; its workflow file may be broken" means the workflow file at that commit no longer parses. Re-running an old attempt fails because only the latest attempt is eligible.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →