Skip to content

Commit 9e11f0a

Browse files
Wolfgang Romanowskiopenshift-merge-bot[bot]
authored andcommitted
added snyk dockerfile scan funcitonality CI (nightly + label-gated PR)
1 parent 2273bf7 commit 9e11f0a

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Snyk scan for training‑runtime Dockerfiles
2+
# push to main, nightly 03:00 UTC, fork PRs after label `run‑snyk`
3+
# Fails on High/Critical CVEs
4+
name: Snyk Dockerfile Scan
5+
on:
6+
push:
7+
branches: [ main ]
8+
pull_request_target:
9+
types: [ labeled ]
10+
schedule:
11+
- cron: '0 3 * * *'
12+
jobs:
13+
snyk-scan:
14+
if: |
15+
github.event_name == 'schedule' ||
16+
github.event_name == 'push' ||
17+
(github.event_name == 'pull_request_target' &&
18+
contains(github.event.pull_request.labels.*.name, 'run-snyk'))
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
# for pull_request_target scan the PR head commit
24+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
25+
- uses: snyk/actions/setup@master
26+
with:
27+
token: ${{ secrets.SNYK_TOKEN }}
28+
- name: Scan Dockerfiles
29+
shell: bash
30+
run: |
31+
set -euo pipefail
32+
find images/runtime/training -name Dockerfile | while read f; do
33+
snyk iac test "$f" --severity-threshold=high
34+
done

0 commit comments

Comments
 (0)