Skip to content

Commit 5153752

Browse files
authored
add Snyk scanning support as GitHub workflow (#160)
1 parent 8c542ff commit 5153752

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/snyk-scan.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Snyk
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
schedule:
9+
# 17:30 UTC (9:30am/10:30am Pacific) every Tuesday
10+
- cron: '30 17 * * 2'
11+
12+
jobs:
13+
snyk:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Download and configure Snyk CLI
18+
run: |
19+
curl -Lo ./snyk https://github.com/snyk/snyk/releases/latest/download/snyk-linux
20+
chmod 755 snyk
21+
- name: Execute scan
22+
env:
23+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
24+
run: |
25+
./snyk test \
26+
--severity-threshold=medium \
27+
--all-projects \
28+
--policy-path=. \
29+
--sarif-file-output=snyk.sarif
30+
- name: Upload scan
31+
if: ${{ failure() && github.event_name == 'schedule' }}
32+
uses: github/codeql-action/upload-sarif@v1
33+
with:
34+
sarif_file: snyk.sarif

0 commit comments

Comments
 (0)