ci/job-timeouts
CI jobs have timeouts
| Severity | info |
| Tiers | all |
| Stacks | any |
| Scope | root |
| Kind | expr |
| Source | library v0.2.0 |
| Selected by | fleetlint-recommended@v0.2.0 |
Requirement
Every Actions job sets timeout-minutes (reusable-workflow jobs excepted); every GitLab job sets timeout: or inherits one from default: timeout: (trigger jobs excepted). The GitLab project timeout lives outside the repository and does not count.
Why
The default job timeout is six hours on GitHub and one hour on GitLab, both far longer than a hung job deserves.
Applies when
workflows().size() > 0Check
For each item in:
workflows().map(w, jobs(w).map(j, {
"path": w,
"name": j.name,
"ok": j.timeout_minutes > 0 || j.uses != ""
|| (ci_kind(w) == "gitlab" && (
(type(yaml(w)[j.name]) == map && "trigger" in yaml(w)[j.name])
|| workflows().exists(g, ci_kind(g) == "gitlab" && type(yaml(g)) == map && "default" in yaml(g)
&& type(yaml(g)["default"]) == map && "timeout" in yaml(g)["default"])))
})).flatten()item.okFix
Add timeout-minutes: 15 (GitLab: timeout: 15m, or once under default:) sized to what the job needs.
Agent instruction: Add timeout-minutes to each Actions job in the flagged file (GitLab: timeout: per job or under default:), sized to roughly twice its typical duration.
See: https://fleetlint.org/baseline/#continuous-integration
Generated by fleetlint docs from catalog v0.2.0.