Skip to content

Commit 12a754c

Browse files
authored
Create Snyk build
1 parent e4aaadb commit 12a754c

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/Snyk build

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: SNYK
2+
on:
3+
push:
4+
branches: [ master ]
5+
pull_request:
6+
branches: [ master ]
7+
8+
jobs:
9+
build:
10+
name: Test and build
11+
environment: snyk-npm
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [v22.6.0]
17+
18+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Use Node.js ${{v22.6.0}}
23+
uses: actions/setup-node@v2
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
cache: 'npm'
27+
28+
- 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
29+
run: |
30+
npm install snyk -g
31+
npm install snyk-to-html -g
32+
snyk auth ${{secrets.SNYK_AUTH}}
33+
34+
- name: Snyk Open Source # For testing and failing please add snyk test before snyk monitor
35+
run: |
36+
snyk monitor
37+
# For a list of additional available flags/options see: https://docs.snyk.io/snyk-cli/commands
38+
39+
- name: Snyk Code # Remove || true to fail if there are vulnerabilities
40+
run: |
41+
snyk code test || true
42+
- name: Snyk Container # Rename your image, for testing and failing please add snyk container test before snyk container monitor
43+
run: |
44+
docker build . -t yourimage:tag
45+
snyk container monitor yourimage:tag --file=Dockerfile
46+
- name: Snyk IaC # Remove || true to fail if there are vulnerabilities
47+
run: |
48+
snyk iac test || true

0 commit comments

Comments
 (0)