Skip to content
Latchkey

How to Set a Job Timeout in GitHub Actions

A timeout-minutes cap stops a hung job from running to the 6-hour default and wasting minutes.

Set timeout-minutes on a job to bound the whole job, or on a step to bound just that step. The job default is 360 minutes.

Job- and step-level timeouts

The job is capped at 30 minutes; the flaky step gets a tighter 10-minute cap.

.github/workflows/ci.yml
jobs:
  test:
    runs-on: ubuntu-latest
    timeout-minutes: 30
    steps:
      - uses: actions/checkout@v4
      - run: npm ci
      - run: npm test
        timeout-minutes: 10

Gotchas

  • The default job timeout is 360 minutes (6 hours) - a hung job runs that long and bills you unless you cap it.
  • A timed-out job is marked failed, not cancelled; downstream needs: jobs are skipped.
  • Step-level timeout-minutes only bounds that step - set a job-level cap as a backstop.

Related guides

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