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: 10Gotchas
- 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-minutesonly bounds that step - set a job-level cap as a backstop.
Related guides
How to Retry a Failed Step or Job in GitHub ActionsHow to retry failed GitHub Actions steps and jobs - manual re-runs, retry actions with backoff, and automatic…
How to Set a Job Timeout in GitLab CISet a job timeout in GitLab CI with the timeout keyword, how it interacts with the project and runner timeout…