review: only add snapshot for factory job. remove context which isn't applicable

This commit is contained in:
Lawrence Gripper
2025-09-09 10:31:20 +00:00
committed by GitHub
parent cec59d9a4d
commit 7cf82aa761
+38 -52
View File
@@ -1733,8 +1733,7 @@
"if": "job-if",
"permissions": "permissions",
"concurrency": "job-concurrency",
"strategy": "strategy",
"snapshot": "snapshot"
"strategy": "strategy"
}
}
},
@@ -1828,56 +1827,6 @@
}
}
},
"snapshot": {
"description": "Use `snapshot` to generate a custom image from this job.",
"one-of": [
"string",
"snapshot-mapping"
]
},
"snapshot-mapping": {
"mapping": {
"properties": {
"if": "snapshot-if",
"image-name": {
"type": "non-empty-string",
"required": true,
"description": "The image name."
},
"version": {
"type": "string",
"description": "The major version to publish the snapshot as, use * to auto-increment minor version"
},
"tags": {
"type": "sequence-of-non-empty-string",
"description": "An array of tags to apply to the snapshot."
}
}
}
},
"snapshot-if": {
"description": "You can use the `if` conditional to prevent a snapshot from being created unless a condition is met. You can use any supported context and expression to create a conditional.",
"context": [
"github",
"inputs",
"vars",
"needs",
"strategy",
"matrix",
"steps",
"job",
"runner",
"env",
"always(0,0)",
"failure(0,0)",
"cancelled(0,0)",
"success(0,0)",
"hashFiles(1,255)"
],
"string": {
"is-expression": true
}
},
"matrix": {
"description": "Use `matrix` to define a matrix of different job configurations. Within your matrix, define one or more variables followed by an array of values.",
"mapping": {
@@ -1906,6 +1855,43 @@
"loose-value-type": "any"
}
},
"snapshot": {
"description": "Use `snapshot` to define a custom image you want to create or update after your job succeeds by taking a snapshot of your runner.",
"one-of": [
"non-empty-string",
"snapshot-mapping"
]
},
"snapshot-mapping": {
"mapping": {
"properties": {
"image-name": {
"description": "The desired name of the custom image you want to create or update.",
"type": "non-empty-string",
"required": true
},
"if": "snapshot-if",
"version": {
"description": "The desired major version updates upon a new custom image version creation.",
"type": "non-empty-string"
}
}
}
},
"snapshot-if": {
"context": [
"github",
"inputs",
"vars",
"needs",
"strategy",
"matrix"
],
"description": "Use the if conditional to prevent a snapshot from being taken unless a condition is met. Any supported context and expression can be used to create a conditional. Expressions in an `if` conditional do not require the bracketed expression syntax. When you use expressions in an `if` conditional, you may omit the expression syntax because GitHub automatically evaluates the `if` conditional as an expression.",
"string": {
"is-expression": true
}
},
"runs-on": {
"description": "Use `runs-on` to define the type of machine to run the job on.\n* The destination machine can be either a GitHub-hosted runner, larger runner, or a self-hosted runner.\n* You can target runners based on the labels assigned to them, or their group membership, or a combination of these.\n* You can provide `runs-on` as a single string or as an array of strings.\n* If you specify an array of strings, your workflow will execute on any runner that matches all of the specified `runs-on` values.\n* If you would like to run your workflow on multiple machines, use `jobs.<job_id>.strategy`.",
"context": [