-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (70 loc) · 2.32 KB
/
snyk.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Use Snyk to find and fix vulnerabilities in your GitHub repository.
# https://github.com/snyk/actions/
name: Snyk Security
on:
# Allow developers to run this on-demand.
workflow_dispatch:
# Scan every Sunday at 1am
schedule:
- cron: '0 1 * * SUN'
# Scan every push to main branch
push:
branches:
- main
# Scan every pull request to main branch
pull_request:
branches:
- main
permissions:
contents: read
env:
# Don't install husky hooks
# https://typicode.github.io/husky/how-to.html#ci-server-and-docker
HUSKY: 0
jobs:
snyk:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
# Have to setup node twice as workaround until corepack is supported.
# https://github.com/actions/setup-node/issues/531
- name: Setup Node (corepack-prereq)
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Enable corepack (yarn-prereq)
shell: bash
run: corepack enable
- name: Setup Node and Yarn
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: yarn
cache-dependency-path: yarn.lock
- name: Install dependencies
run: yarn install --immutable
- name: Setup Snyk
uses: snyk/actions/setup@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
- name: Snyk Code Scan
run: snyk code test --sarif > snyk-code.sarif
continue-on-error: true # so that the SARIF upload gets called
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
- name: Snyk Open Source Monitor
run: snyk monitor --all-projects
continue-on-error: true # so that the SARIF upload gets called
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
- name: Upload results to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v3
continue-on-error: true
with:
sarif_file: snyk-code.sarif
category: Snyk