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
* Workflow-level timeout is fixed at 360 minutes by GitHub.
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.