Skip to content

CICD-020 · Set a job timeout ​

Encyclopedia · Jobs, steps and runner selection · All snippets

Previous · CICD-019 · Next · CICD-021

1. Where it fits ​

  • Placement .github/workflows/ci.yml, inside the relevant job.
  • Prerequisites workflow containing the named example jobs or steps.
  • Platforms github-actions, gitea-actions.

2. Copy the snippet ​

yaml
timeout-minutes: 10

3. How it works ​

timeout-minutes bounds the entire job. Subprocesses should also have their own useful deadlines so their diagnostics can be recorded before the runner cancels them.

4. Verify the result ​

Bound a job that can hang. Use a short disposable proof job to observe late-step cancellation.

Validation syntax-validated (YAML parse). Status definitions.