forked from alexeisnyk/juice-shop
-
Notifications
You must be signed in to change notification settings - Fork 2
78 lines (63 loc) · 1.93 KB
/
npm-grunt.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
name: NodeJS with Grunt
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Build
run: |
npm install
grunt
name: Snyk SCA, Code, IaC and Container CLI monitor example
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
name: Test and build
environment: snyk-npm
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [v22.6.0]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{v22.6.0}}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Setup Snyk + snyk-to-html # For information about the required commands for generating an HTML report see https://github.com/snyk/snyk-to-html
run: |
npm install snyk -g
npm install snyk-to-html -g
snyk auth ${{secrets.SNYK_AUTH}}
- name: Snyk Open Source # For testing and failing please add snyk test before snyk monitor
run: |
snyk monitor
# For a list of additional available flags/options see: https://docs.snyk.io/snyk-cli/commands
- name: Snyk Code # Remove || true to fail if there are vulnerabilities
run: |
snyk code test || true
- name: Snyk Container # Rename your image, for testing and failing please add snyk container test before snyk container monitor
run: |
docker build . -t yourimage:tag
snyk container monitor yourimage:tag --file=Dockerfile
- name: Snyk IaC # Remove || true to fail if there are vulnerabilities
run: |
snyk iac test || true