timeout-minutes setting. By default, a workflow is killed after 360 minutes (6 hours), but you can customize the timeout at both the step and job levels to prevent runaway executions and save minutes.
Default Behavior
Without any explicit timeout, GitHub Actions enforces a global 360-minute limit:If any step (e.g., a stray
sleep 6000s) runs longer than 6 hours, the entire workflow will be forcefully terminated.Example: No Timeout Specified
This sample workflow accidentally includes a longsleep command with no timeout:
timeout-minutes, this workflow could run until GitHub Actions kills it after six hours.
Step-Level Timeout
To limit only one step—regardless of other steps—you can settimeout-minutes on that specific step:
Job-Level Timeout
Applying a timeout at the job level ensures the sum of all steps in that job respects the limit:Timeout Comparison
| Scope | Applies To | Syntax Location | Example Duration |
|---|---|---|---|
| Step-level | Single step only | Under a steps item | timeout-minutes: 1 |
| Job-level | All steps in a job | Under a jobs item | timeout-minutes: 5 |
| Workflow-level* | Entire workflow | Not user-configurable (360 min default) | 360 min |
Demonstration
- Commit and push your updated workflow or trigger it with Run workflow.
- Monitor the Docker Run with Timeout step in the Actions UI.
-
After the specified timeout, you’ll see an error like:
- Under Annotations, GitHub pinpoints which step or job exceeded its limit.