-
Notifications
You must be signed in to change notification settings - Fork 4
39 lines (35 loc) · 992 Bytes
/
snyk-scan.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Snyk scan
on:
push:
branches:
- main
- 'v[0-9]+'
pull_request:
branches:
- main
- 'v[0-9]+'
jobs:
snyk-security:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/golang@master
continue-on-error: true # To make sure that SARIF upload gets called
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --all-projects --sarif-file-output=snyk.sarif
- name: Check output file
id: out-file
run: |
if test -f "snyk.sarif"; then
echo "::set-output name=exists::true"; else
echo "::set-output name=exists::false"
fi
- name: Upload result to GitHub Code Scanning
if: steps.out-file.outputs.exists == 'true'
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: snyk.sarif