-
Notifications
You must be signed in to change notification settings - Fork 6
47 lines (46 loc) · 1.58 KB
/
snyk-master.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
40
41
42
43
44
45
46
47
name: Snyk
on:
schedule:
- cron: '0 0 * * 1-5'
push:
branches:
- master
pull_request:
workflow_run:
workflows:
- Create release
types:
- completed
jobs:
snyk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
- name: Prepare snyk
run: |
npm ci
yarn install --no-immutable --mode=skip-build
- name: Snyk Monitor
continue-on-error: true
if: ${{ github.event_name != 'pull_request' }}
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
NODE_OPTIONS: --max-old-space-size=8192
run: npx snyk monitor --dev --yarn-workspaces --exclude="project.json,npm-shim"
- name: Snyk Test
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
NODE_OPTIONS: --max-old-space-size=8192
run: npx snyk test --dev --yarn-workspaces --exclude="project.json,npm-shim" --sarif-file-output=./sarifs/snyk.sarif
- name: Snyk Code
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
NODE_OPTIONS: --max-old-space-size=8192
run: npx snyk code test --dev --all-projects --exclude="project.json,npm-shim" --sarif > ./sarifs/snyk-code.sarif
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@7cce9bbfb550e880420fd42bdb2f6a2908df139e # tag=v1
with:
sarif_file: ./sarifs