Skip to content

Commit 958c018

Browse files
authored
feat: add support for trivy on lock files
1 parent cbbba73 commit 958c018

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/actions/build-node-python/action.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ inputs:
5959
description: "run node bundle"
6060
default: "false"
6161
required: false
62+
enable_trivy:
63+
description: "Enable trivy scans on lock files"
64+
default: "false" # Enable this by default?
65+
required: false
6266
chromatic_enable:
6367
description: "Enable Chromatic tests"
6468
required: false
@@ -287,6 +291,35 @@ runs:
287291
UV_SYSTEM_PYTHON: 1 # In case uv pip is used, install into the system python environment https://docs.astral.sh/uv/guides/integration/github/#using-uv-pip
288292
UV_HTTP_TIMEOUT: 300 # https://docs.astral.sh/uv/reference/environment/#uv_http_timeout
289293

294+
# Trivy
295+
- name: Run Trivy vulnerability scanner on uv.lock
296+
if: inputs.enable_trivy == 'true' && inputs.enable_python == 'true'
297+
uses: aquasecurity/[email protected]
298+
with:
299+
scan-type: "fs"
300+
scan-ref: "uv.lock"
301+
format: "table"
302+
exit-code: "1"
303+
scaners: "vuln"
304+
severity: "HIGH,CRITICAL"
305+
ignore-unfixed: false
306+
# The cache update takes quite long, so let's try to disable it for now: https://github.com/aquasecurity/trivy-action#cache
307+
cache: "false"
308+
continue-on-error: false
309+
- name: Run Trivy vulnerability scanner on yarn.lock
310+
if: inputs.enable_trivy == 'true' && inputs.enable_node == 'true'
311+
uses: aquasecurity/[email protected]
312+
with:
313+
scan-type: "fs"
314+
scan-ref: "yarn.lock"
315+
format: "table"
316+
exit-code: "1"
317+
scaners: "vuln"
318+
severity: "HIGH,CRITICAL"
319+
ignore-unfixed: false
320+
# The cache update takes quite long, so let's try to disable it for now: https://github.com/aquasecurity/trivy-action#cache
321+
cache: "false"
322+
continue-on-error: false
290323
# Node
291324
- name: Save yarn cache
292325
uses: actions/cache/save@v4

0 commit comments

Comments
 (0)