-
Notifications
You must be signed in to change notification settings - Fork 28
39 lines (37 loc) · 1.11 KB
/
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
on:
push:
branches: [ main ]
paths:
- '**gradle**' # build.gradle.kts, settings.gradle.kts, gradle.properties, etc.
- '**snyk**' # .snyk, snyk-scan.yml
pull_request:
branches: [ main ]
paths:
- '**gradle**'
- '**snyk**'
schedule:
- cron: '0 17 * * 2' # 17:00 UTC (9am/10am Pacific) every Tuesday
jobs:
snyk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download and configure Snyk CLI
run: |
curl -Lo ./snyk https://github.com/snyk/snyk/releases/latest/download/snyk-linux
chmod 755 snyk
- name: Execute scan
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
run: |
./snyk test \
--severity-threshold=medium \
--all-projects \
--policy-path=. \
--sarif-file-output=snyk.sarif
- name: Upload scan
if: ${{ failure() && github.event_name == 'schedule' }}
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: snyk.sarif