You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/actions/how-tos/manage-runners/larger-runners/use-custom-images.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,6 +94,24 @@ jobs:
94
94
# Add any steps to download and setup any dependencies here
95
95
```
96
96
97
+
### Conditionals
98
+
99
+
The `snapshot` keyword supports conditional execution using the `if` keyword around the snapshot mapping. You can use conditions to control when an image snapshot is created. For example, the following job skips image creation for tag builds.
100
+
101
+
```yaml
102
+
jobs:
103
+
build:
104
+
runs-on: my-image-generation-runner
105
+
snapshot:
106
+
if: {% raw %}${{ ! startsWith(github.ref, 'refs/tags/') }}{% endraw %}
107
+
image-name: my-custom-image
108
+
version: 2.*
109
+
steps:
110
+
# Add any steps to download and setup any dependencies here
111
+
```
112
+
113
+
For more information about the `if` keyword, see [AUTOTITLE](/actions/how-tos/write-workflows/choose-when-workflows-run/control-jobs-with-conditions).
114
+
97
115
## Versioning
98
116
99
117
When you generate custom images, {% data variables.product.github %} automatically assigns version numbers to help you manage updates and track image history.
0 commit comments