Skip to content

Commit a62ab12

Browse files
authored
FMWK-249 Add Snyk scan workflow (#152)
1 parent 6ca9582 commit a62ab12

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/snyk-scan.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Snyk scan
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
10+
jobs:
11+
snyk-security:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
17+
- name: Run Snyk to check for vulnerabilities
18+
uses: snyk/actions/maven@master
19+
continue-on-error: true # To make sure that SARIF upload gets called
20+
env:
21+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
22+
with:
23+
args: --all-projects --sarif-file-output=snyk.sarif
24+
25+
- name: Check output file
26+
id: out-file
27+
run: |
28+
if test -f "snyk.sarif"; then
29+
echo "::set-output name=exists::true"; else
30+
echo "::set-output name=exists::false"
31+
fi
32+
33+
- name: Upload result to GitHub Code Scanning
34+
if: steps.out-file.outputs.exists == 'true'
35+
uses: github/codeql-action/upload-sarif@v2
36+
with:
37+
sarif_file: snyk.sarif

0 commit comments

Comments
 (0)