Skip to content

Commit 48e8aab

Browse files
committed
chore: add optional snyk token
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
1 parent cd3407c commit 48e8aab

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.github/workflows/bake.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ jobs:
5151
with:
5252
environment: ${{ github.event.inputs.environment }}
5353
postgresql_version: ${{ matrix.version }}
54+
secrets:
55+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
5456

5557
Catalogs:
5658
name: Update Catalogs

.github/workflows/bake_targets.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ on:
2929
`source` directory.
3030
required: false
3131
type: string
32+
secrets:
33+
SNYK_TOKEN:
34+
required: false
3235

3336
permissions: {}
3437

@@ -158,21 +161,23 @@ jobs:
158161

159162
- name: Snyk
160163
uses: snyk/actions/docker@master
161-
continue-on-error: true
164+
id: snyk
165+
if: ${{ env.SNYK_TOKEN != '' }}
162166
env:
163167
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
164168
with:
165169
image: "${{ matrix.image }}"
166170
args: --severity-threshold=high --file=Dockerfile
167171

168172
- name: Replace sarif security-severity invalid values
173+
if: ${{ steps.snyk.conclusion == 'success' }}
169174
run: |
170175
sed -i 's/"security-severity": "null"/"security-severity": "0"/g' snyk.sarif
171176
sed -i 's/"security-severity": "undefined"/"security-severity": "0"/g' snyk.sarif
172177
173178
- name: Upload result to GitHub Code Scanning
174179
uses: github/codeql-action/upload-sarif@192325c86100d080feab897ff886c34abd4c83a3 # v3
175-
continue-on-error: true
180+
if: ${{ steps.snyk.conclusion == 'success' }}
176181
with:
177182
sarif_file: snyk.sarif
178183

0 commit comments

Comments
 (0)