Skip to content

Commit a9f3890

Browse files
committed
Add Snyk action for vulnerability scanning
1 parent 36e8ae2 commit a9f3890

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Snyk scheduled test
2+
on:
3+
schedule:
4+
- cron: '0 2 * * 1'
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
security:
11+
runs-on: ubuntu-latest
12+
env:
13+
REPORT_FILE: test.json
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Use Node.js 16
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: 16
21+
22+
- name: Run Snyk to check for vulnerabilities
23+
uses: snyk/actions/gradle-jdk17@master
24+
env:
25+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
26+
with:
27+
args: --all-projects --configuration-matching='^runtimeClasspath$' --fail-on=upgradable --severity-threshold=high --json-file-output=${{ env.REPORT_FILE }}
28+
29+
- name: Report new vulnerabilities
30+
uses: thehyve/report-vulnerability@master
31+
if: success() || failure()
32+
with:
33+
report-file: ${{ env.REPORT_FILE }}
34+
env:
35+
TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/snyk.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Snyk test
2+
on:
3+
pull_request:
4+
branches: [ main, dev ]
5+
jobs:
6+
security:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
11+
- name: Run Snyk to check for vulnerabilities
12+
uses: snyk/actions/gradle-jdk17@master
13+
env:
14+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
15+
with:
16+
args: --all-projects --configuration-matching='^runtimeClasspath$' --severity-threshold=high

0 commit comments

Comments
 (0)