Skip to content

Commit 91ed6f2

Browse files
committed
🔒 security: enhance snyk scan workflow with SARIF reporting
Remove continue-on-error setting to enforce vulnerability detection and add SARIF file generation for better visibility of security issues in GitHub's Security tab. This change enables automated security reporting while maintaining high severity threshold checks.
1 parent dd2e8ed commit 91ed6f2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/snyk-scan.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,18 @@ jobs:
3939

4040
- name: Run Snyk to check for vulnerabilities
4141
uses: snyk/actions/node@master
42-
continue-on-error: true # Allow other steps to run if Snyk test has findings but doesn't hard fail
42+
# continue-on-error: true # Removed: Let the step fail if vulns above threshold are found
4343
env:
4444
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
4545
with:
4646
command: "test"
47-
args: "--all-projects --severity-threshold=high"
47+
args: "--all-projects --sarif-file-output=snyk.sarif --severity-threshold=high"
48+
49+
- name: Upload Snyk SARIF report to GitHub Security tab
50+
if: always() # Run this step even if the Snyk step failed or had no findings
51+
uses: github/codeql-action/upload-sarif@v3
52+
with:
53+
sarif_file: snyk.sarif
4854

4955
- name: Snyk Monitor (only for pushes to main branch)
5056
if: github.event_name == 'push' && github.ref == 'refs/heads/main'

0 commit comments

Comments
 (0)