Skip to content

Commit 62700eb

Browse files
author
Gonzalo Diaz
committed
[CONFIG] Docker: snyk actions splitted
1 parent 6678ae2 commit 62700eb

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

.github/workflows/docker-image.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ jobs:
110110
run: |
111111
docker run --rm ${{ env.IMAGE_NAME }}:test make test
112112
113-
security:
113+
snyk-image:
114114
name: "Snyk Container"
115115
runs-on: ubuntu-24.04
116116
needs: build
@@ -141,6 +141,38 @@ jobs:
141141
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
142142
with:
143143
image: ${{ env.IMAGE_NAME }}:${{ github.sha }}
144+
145+
# yamllint disable rule:line-length
146+
# https://github.com/github/codeql-action/issues/2187#issuecomment-2043220400
147+
- name: Replace security-severity undefined for license-related findings
148+
run: |
149+
sed -i 's/"security-severity": "undefined"/"security-severity": "0"/g' snyk.sarif
150+
sed -i 's/"security-severity": "null"/"security-severity": "0"/g' snyk.sarif
151+
# yamllint enable rule:line-length
152+
- name: Upload result to GitHub Code Scanning
153+
uses: github/codeql-action/upload-sarif@v3
154+
with:
155+
sarif_file: 'snyk.sarif'
156+
157+
snyk-docker:
158+
name: "Snyk Docker"
159+
runs-on: ubuntu-24.04
160+
needs: build
161+
steps:
162+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #
163+
- name: Run Snyk to check Docker image for vulnerabilities
164+
# Snyk can be used to break the build when it detects vulnerabilities.
165+
# In this case we want to upload the issues to GitHub Code Scanning
166+
continue-on-error: true
167+
uses: snyk/actions/docker@master
168+
env:
169+
# yamllint disable rule:line-length
170+
# In order to use the Snyk Action you will need to have a Snyk API token.
171+
# See https://docs.snyk.io/integrations/ci-cd-integrations/github-actions-integration#getting-your-snyk-token
172+
# or you can sign up for free at https://snyk.io/login
173+
# yamllint enable rule:line-length
174+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
175+
with:
144176
args: --file=Dockerfile
145177
# yamllint disable rule:line-length
146178
# https://github.com/github/codeql-action/issues/2187#issuecomment-2043220400
@@ -153,6 +185,7 @@ jobs:
153185
uses: github/codeql-action/upload-sarif@v3
154186
with:
155187
sarif_file: 'snyk.sarif'
188+
156189
scan:
157190
name: "Trivy"
158191
runs-on: ubuntu-24.04

0 commit comments

Comments
 (0)