One line caps a hung GitHub Actions job
A frozen test can keep one GitHub Actions job running for 360 minutes. That is 6 hours.
Published here , updated · 3 sources · Resume reading
A frozen test can keep one GitHub Actions job running for 360 minutes. That is 6 hours, the default when the job has no timeout [1]. One line under each job makes GitHub stop it at your limit instead of burning a full window of runner time [1][2].
One minute: add the ceiling
Put timeout-minutes under each job, next to runs-on [1][3]:
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4Set the number to about 2 to 3 times that job's normal healthy run. A 5 minute unit suite often gets 15. A flaky 20 minute integration job might get 45, not 360.
Find workflow files with no timeout
grep -rL "timeout-minutes" .github/workflowsOn a throwaway tree with one capped and one uncapped workflow, that command printed only the uncapped file:
.github/workflows/ci.ymlCaptured setup on this host:
mkdir -p /tmp/wfdemo/.github/workflows
# ci.yml has no timeout; lint.yml sets timeout-minutes: 10
cd /tmp/wfdemo && grep -rL "timeout-minutes" .github/workflowsgrep -L checks whole files, not jobs. A file where only one job (or only a step) has a timeout will not show up, so still open each job and confirm a ceiling next to runs-on [1].
Unset jobs inherit a six-hour ceiling; an explicit job timeout is the hard stop for a frozen step.
Why the number matters on the bill
Private repos: hosted runner time comes out of your plan's included usage, then gets billed. GitHub's Actions billing docs list a common baseline of $0.006 per minute for standard Linux runners on private repositories [2].
Public repos: standard GitHub-hosted runners do not burn that private meter the same way, but the check stays pending until the hung job ends. Reviewers wait. Required checks stay yellow. Merges stall for hours while nothing useful runs [1][2].
Napkin math for one uncapped hang on a private Linux runner:
360 minutes * $0.006 = $2.16
15 minutes * $0.006 = $0.09One forgotten ceiling is cheap compared with a week of flaky hangs. Matrix jobs multiply the problem: four OS cells without timeouts can each burn toward 360 minutes independently [2][3].
Job timeout versus step timeout
GitHub lets you set timeouts at more than one level. A step timeout stops that step. The job can continue with later steps unless you also cap the job [1][3]. Prefer an explicit job-level timeout-minutes you can read next to runs-on, then add tighter step limits only where a single install or test is known to wedge.
Workflow-level timeouts and job-level timeouts are easy to confuse in review. Put the ceiling on the job that bills the runner minutes you care about [1].
Pair this with cancel-in-progress
Timeouts stop hangs. Concurrency groups stop obsolete PR heads from finishing after you pushed again. Both save minutes; neither replaces the other. For cancel-replaced-run patterns and docs-only skips, see save GitHub Actions minutes.
Mistakes that keep the six-hour window
Setting timeout-minutes on one job in a file and trusting grep -L to flag that file when another job is uncapped.
Copying timeout-minutes: 360 "to be safe," which is the default you already had [1].
Capping a fast lint job at 5 minutes while leaving the flaky e2e job uncapped.
Putting the timeout only on a composite action step and never on the job that wraps a matrix.
Raising the timeout every time a suite slows down instead of fixing the hang, until you are back near six hours.
Rollout that does not surprise night shifts
- List workflows with
grep -rL "timeout-minutes" .github/workflows. - Open every listed file and every multi-job file the grep missed.
- Set a ceiling per job from recent healthy runtimes (2 to 3x).
- Watch cancelled-by-timeout runs for a week; raise only the jobs that hit a real slow path.
- Add concurrency cancel for PR heads separately (ci-minutes).
When a job hits your ceiling, GitHub fails it instead of letting it idle until 360. That failure is the signal to fix the hang, not a reason to delete the timeout.
What a timeout failure looks like in the UI
The job is marked failed with a timeout message rather than a test assertion. Required checks that depend on that job go red. That is better than a six-hour yellow pending state that blocks merges while nobody is watching [1]. Tell the team in advance so people do not "fix" a timeout by deleting the ceiling on a Friday deploy workflow.
If only one matrix cell hangs, the whole matrix job still occupies a runner until the job timeout fires unless you structure cells as separate jobs with their own ceilings [3]. Prefer per-job timeouts you can read next to each runs-on line.
Self-hosted runners and bigger machines
Self-hosted runners are not free just because GitHub is not billing the hosted meter the same way. A hung job still occupies the machine, blocks the queue, and can leave browsers or emulators wedged until someone SSH's in. Timeouts reclaim the runner for the next workflow [1]. Larger hosted runners multiply the private-repo minute price, so an uncapped hang hurts more on those labels [2].
Reusable workflows and composite actions
A reusable workflow called with uses: still runs jobs that need their own timeout-minutes in the callee or caller depending on how you structured them [1][3]. Do not assume a timeout in the caller covers every nested job. After a refactor that extracts a reusable workflow, re-run the grep -rL pass on both repositories if the workflow lives in a shared actions repo.
Composite actions expose step-level timing more than job-level timing. Keep the job ceiling in the workflow that pays for the runner, and add step timeouts only for known sticky installs (browser download, emulator boot).
Flaky suites versus true hangs
A flaky test that finishes in 8 minutes does not need a 360 minute budget. A true hang (waiting on a lock, waiting on a missing service, waiting on a GUI prompt) needs a kill. If you keep raising timeouts to hide flakes, you recreate the default. Cap first, then fix the hang with better service readiness checks, deterministic ports, and fewer shared mutable fixtures. Pair with cancel-in-progress so obsolete PR heads do not keep running after a fix push (ci-minutes).
Audit snippet you can paste into a PR checklist
[ ] Every job under .github/workflows has timeout-minutes next to runs-on
[ ] Ceilings are 2x to 3x recent healthy duration, not 360
[ ] Matrix cells cannot each burn uncapped hours
[ ] Reusable workflow jobs still carry ceilings
[ ] On-call knows a timeout failure means fix the hang, not delete the capRun the grep in CI as a policy check if your org already lints workflows. A missing string is cheaper to catch in a pull request than on the bill [2].
Also run the five GitHub Actions workflow checks on the same workflows. Browse the Dev tools topic.
Send this to the friend whose stuck test kept a GitHub Actions runner burning minutes.

Keep this guide
Filed under Dev tools
Questions about this guide
What is the default timeout?
360 minutes (6 hours). That is how long a hung job will bill if you do not set a cap.
Where does timeout-minutes go?
Under EACH job, next to runs-on. Set it to about 2 to 3 times that job's normal run.
Does a step timeout replace a job timeout?
No. A step can finish or fail on its own limit while the job keeps running other steps. Cap the job too.
Are public repos free from this problem?
Standard hosted runners on public repos do not burn the same private-minute meter, but the check stays pending until the hung job ends.
Sources
- GitHub docs: timeout-minutesdocs.github.com
- GitHub docs: Actions billingdocs.github.com
- GitHub docs: workflow syntax (jobs)docs.github.com