4040 # Snyk can be used to break the build when it detects security issues.
4141 # In this case we want to upload the SAST issues to GitHub Code Scanning
4242 uses : snyk/actions/setup@cdb760004ba9ea4d525f2e043745dfe85bb9077e
43+ with :
44+ snyk-version : latest
45+
46+ - name : Authenticate Snyk
47+ env :
48+ SNYK_TOKEN : ${{ secrets.SNYK_SECRET_TOKEN }}
49+ run : snyk auth SNYK_TOKEN --auth-type=token
4350
4451 - name : Set up Python
4552 uses : actions/setup-python@19e4675e06535f6b54e894da5c1f044400bb4996
@@ -52,40 +59,19 @@ jobs:
5259 if [ -f Pipfile ]; then pip install pipenv && pipenv install --dev; fi
5360 if [ -f pyproject.toml ]; then pip install poetry && poetry install; fi
5461
55- - name : Set up Snyk
56- uses : snyk/actions/setup@9213221444c2dc9e8b2502c1e857c26d851e84a7
57- with :
58- snyk-version : latest
59-
6062 - name : Run Snyk to check for vulnerabilities
6163 uses : snyk/actions/python-3.10@cdb760004ba9ea4d525f2e043745dfe85bb9077e
6264 continue-on-error : true # To make sure that SARIF upload gets called
6365 env :
6466 SNYK_TOKEN : ${{ secrets.SNYK_SECRET_TOKEN }}
6567 with :
66- args : --sarif-file-output=snyk.sarif --severity-threshold=medium
68+ command : monitor
6769
6870
69- # Runs Snyk Code (SAST) analysis and uploads result into GitHub.
70- # Use || true to not fail the pipeline
71- - name : Snyk Code test
72- run : snyk code test --sarif > snyk-code.sarif # || true
73-
7471 # Runs Snyk Open Source (SCA) analysis and uploads result to Snyk.
7572 - name : Snyk Open Source monitor
76- run : snyk monitor --all-projects
77-
78- # Runs Snyk Infrastructure as Code (IaC) analysis and uploads result to Snyk.
79- # Use || true to not fail the pipeline.
80- - name : Snyk IaC test and report
81- run : snyk iac test --report # || true
82-
83- # Build the docker image for testing
84- - name : Build a Docker image
85- run : docker build -t your/image-to-test .
86- # Runs Snyk Container (Container and SCA) analysis and uploads result to Snyk.
87- - name : Snyk Container monitor
88- run : snyk container monitor your/image-to-test --file=Dockerfile
73+ continue-on-error : true # To make sure that SARIF upload gets called
74+ run : snyk test --all-projects
8975
9076 # Push the Snyk Code results into GitHub Code Scanning tab
9177 - name : Upload result to GitHub Code Scanning
0 commit comments