Skip to content

Commit

Permalink
Add Snyk action for vulnerability scanning
Browse files Browse the repository at this point in the history
  • Loading branch information
pvannierop committed Oct 9, 2024
1 parent 36e8ae2 commit a9f3890
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/scheduled-snyk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Snyk scheduled test
on:
schedule:
- cron: '0 2 * * 1'
push:
branches:
- master

jobs:
security:
runs-on: ubuntu-latest
env:
REPORT_FILE: test.json
steps:
- uses: actions/checkout@v3

- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16

- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/gradle-jdk17@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --all-projects --configuration-matching='^runtimeClasspath$' --fail-on=upgradable --severity-threshold=high --json-file-output=${{ env.REPORT_FILE }}

- name: Report new vulnerabilities
uses: thehyve/report-vulnerability@master
if: success() || failure()
with:
report-file: ${{ env.REPORT_FILE }}
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 16 additions & 0 deletions .github/workflows/snyk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Snyk test
on:
pull_request:
branches: [ main, dev ]
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/gradle-jdk17@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --all-projects --configuration-matching='^runtimeClasspath$' --severity-threshold=high

0 comments on commit a9f3890

Please sign in to comment.