Skip to content

Commit fae0241

Browse files
committed
Allow reusable workflows in custom schema
The github-workflows-require-timeout schema now uses oneOf to select between normal jobs and reusable workflow call jobs. Normal jobs are the ones which must have timeout-minutes, since reusable workflow calls cannot set timeout-minutes.
1 parent 3e2fb87 commit fae0241

File tree

2 files changed

+27
-12
lines changed

2 files changed

+27
-12
lines changed

CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Unreleased
1111
.. vendor-insert-here
1212
1313
- Update vendored schemas (2023-05-30)
14+
- The schema for enforcing timeout-minutes on GitHub Actions jobs has been
15+
updated to allow for workflow call jobs (which cannot have a timeout)
1416

1517
0.23.0
1618
------

src/check_jsonschema/builtin_schemas/custom/github-workflows-require-timeout.json

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,32 @@
88
"patternProperties": {
99
"^[_a-zA-Z][a-zA-Z0-9_-]*$": {
1010
"$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_id",
11-
"type": "object",
12-
"properties": {
13-
"timeout-minutes": {
14-
"$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idtimeout-minutes",
15-
"description": "The maximum number of minutes to let a workflow run before GitHub automatically cancels it. Default: 360",
16-
"type": "number",
17-
"default": 360
11+
"oneOf": [
12+
{
13+
"type": "object",
14+
"properties": {
15+
"timeout-minutes": {
16+
"$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idtimeout-minutes",
17+
"description": "The maximum number of minutes to let a workflow run before GitHub automatically cancels it. Default: 360",
18+
"type": "number",
19+
"default": 360
20+
}
21+
},
22+
"required": [
23+
"runs-on",
24+
"timeout-minutes"
25+
],
26+
"additionalProperties": true
27+
},
28+
{
29+
"$comment": "https://docs.github.com/en/actions/learn-github-actions/reusing-workflows#calling-a-reusable-workflow",
30+
"type": "object",
31+
"required": [
32+
"uses"
33+
],
34+
"additionalProperties": true
1835
}
19-
},
20-
"required": [
21-
"timeout-minutes"
22-
],
23-
"additionalProperties": true
36+
]
2437
}
2538
}
2639
}

0 commit comments

Comments
 (0)