Skip to content

Commit 35f67f3

Browse files
Merge pull request #19 from wiz-sec-public/install-only
Add install-only mode for pre-warming custom runner images (v0.9.1)
2 parents d0cac83 + a34fc25 commit 35f67f3

4 files changed

Lines changed: 103 additions & 26 deletions

File tree

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,48 @@ The token must be a JSON object with exactly these fields:
3737
| Input | Required | Description |
3838
| --- | --- | --- |
3939
| `token` | Yes | JSON token containing registry credentials and Wiz API client credentials. |
40+
| `install-only` | No | Only pull and cache the Wiz Sensor image without starting it. Defaults to `false`. Useful for pre-warming custom GitHub runner images. |
41+
42+
## Pre-warming custom runner images (`install-only`)
43+
44+
When you build a [custom image for GitHub-hosted larger runners](https://docs.github.com/en/actions/how-tos/manage-runners/larger-runners/use-custom-images),
45+
you can bake the Wiz Sensor image into the image so that it does not have to be
46+
downloaded on every job. Run the action with `install-only: true` in your
47+
image-generation (`snapshot`) workflow. In this mode the action pulls the sensor
48+
image into the local Docker daemon and exits without starting the sensor. The
49+
same `token` is used as for a normal run.
50+
51+
The Docker image is the only artifact worth caching ahead of time. The sensor
52+
refreshes its detection content at runtime, so nothing else needs to be prepared
53+
during image generation.
54+
55+
```yaml
56+
jobs:
57+
build-image:
58+
runs-on: my-image-generation-runner
59+
snapshot: my-custom-image
60+
steps:
61+
- uses: wiz-sec-public/wiz-sensor-github-action@v0.9
62+
with:
63+
install-only: true
64+
token: ${{ secrets.WIZ_SENSOR_TOKEN }}
65+
# ... any other tools you want to pre-install
66+
```
67+
68+
Then, in jobs that run on the custom image, use the action as usual. When the
69+
sensor image is already cached locally, the action skips the registry login and
70+
pull and starts the sensor directly from the cached image:
71+
72+
```yaml
73+
jobs:
74+
build:
75+
runs-on: my-custom-runner
76+
steps:
77+
- uses: wiz-sec-public/wiz-sensor-github-action@v0.9
78+
with:
79+
token: ${{ secrets.WIZ_SENSOR_TOKEN }}
80+
# ... your build steps
81+
```
4082

4183
## Required permissions
4284

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ inputs:
1717
description: "Wait for the Wiz Sensor to report ready before continuing"
1818
required: false
1919
default: "true"
20+
install-only:
21+
description: "Only pull and cache the Wiz Sensor image without starting it. Useful for pre-warming custom GitHub runner images."
22+
required: false
23+
default: "false"
2024
debug-logs:
2125
description: "Enable debug logging for the action"
2226
required: false

dist/main/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)