File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,15 +39,25 @@ jobs:
3939 SNYK_TOKEN : ${{ secrets.SNYK_TOKEN }}
4040 steps :
4141 - uses : actions/checkout@v4
42- - name : Set up Snyk CLI to check for security issues
43- uses : snyk/actions/setup@master
44-
4542 - name : Snyk Code test
46- run : snyk code test --sarif-file-output=snyk-code.sarif
43+ uses : snyk/actions/node@master
4744 continue-on-error : true
45+ with :
46+ command : code test
47+ args : --sarif-file-output=snyk-code.sarif
4848 env :
4949 SNYK_TOKEN : ${{ secrets.SNYK_TOKEN }}
5050
51+ - name : Verify SARIF file
52+ run : |
53+ if [ -f snyk-code.sarif ]; then
54+ echo "SARIF file found."
55+ ls -l snyk-code.sarif
56+ else
57+ echo "SARIF file NOT found. Creating empty valid SARIF to prevent crash."
58+ echo '{"$schema":"https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json","version":"2.1.0","runs":[]}' > snyk-code.sarif
59+ fi
60+
5161 # Runs Snyk Open Source (SCA) analysis and uploads result to Snyk.
5262 - name : Snyk Open Source monitor
5363 run : snyk monitor --all-projects || true
You can’t perform that action at this time.
0 commit comments