Skip to content

Commit 77de04a

Browse files
github-workflow: add jobs.<job_id>.snapshot schema (SchemaStore#5247)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent c8f89af commit 77de04a

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

src/schemas/json/github-workflow.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,34 @@
351351
}
352352
]
353353
},
354+
"snapshot": {
355+
"$comment": "https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idsnapshot",
356+
"description": "You can use `jobs.<job_id>.snapshot` to generate a custom image.\nAdd the snapshot keyword to the job, using either the string syntax or mapping syntax as shown in https://docs.github.com/en/actions/how-tos/manage-runners/larger-runners/use-custom-images#generating-a-custom-image.\nEach job that includes the snapshot keyword creates a separate image. To generate only one image or image version, include all workflow steps in a single job. Each successful run of a job that includes the snapshot keyword creates a new version of that image.\nFor more information, see https://docs.github.com/en/actions/how-tos/manage-runners/larger-runners/use-custom-images.",
357+
"oneOf": [
358+
{
359+
"$comment": "https://docs.github.com/en/actions/how-tos/manage-runners/larger-runners/use-custom-images#string-syntax",
360+
"type": "string",
361+
"description": "You can use the string syntax with `snapshot` to define the image name. This method creates a new image or adds a new version to an existing image with the same name. You cannot specify a version number using this syntax."
362+
},
363+
{
364+
"$comment": "https://docs.github.com/en/actions/how-tos/manage-runners/larger-runners/use-custom-images#mapping-syntax",
365+
"type": "object",
366+
"additionalProperties": false,
367+
"description": "You can use the mapping syntax with `snapshot` to define both the `image-name` and the optional `version`. When you specify a major version, the minor versioning automatically increments if that major version already exists. Patch versions are not supported.",
368+
"properties": {
369+
"image-name": {
370+
"type": "string"
371+
},
372+
"version": {
373+
"$comment": "https://docs.github.com/en/actions/how-tos/manage-runners/larger-runners/use-custom-images#specifying-a-version-in-your-workflow",
374+
"type": "string",
375+
"pattern": "^\\d+(\\.\\d+|\\*)?$"
376+
}
377+
},
378+
"required": ["image-name"]
379+
}
380+
]
381+
},
354382
"step": {
355383
"type": "object",
356384
"additionalProperties": false,
@@ -623,6 +651,9 @@
623651
"needs": {
624652
"$ref": "#/definitions/jobNeeds"
625653
},
654+
"snapshot": {
655+
"$ref": "#/definitions/snapshot"
656+
},
626657
"permissions": {
627658
"$ref": "#/definitions/permissions"
628659
},

0 commit comments

Comments
 (0)