Skip to content

Commit

Permalink
Add snyk workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Bdegraaf1234 committed May 7, 2024
1 parent 31fd220 commit d202583
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/scheduled_snyk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
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
- uses: snyk/actions/setup@master
with:
snyk-version: v1.1032.0

- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Run Snyk
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
run: >
snyk test
--all-sub-projects
--configuration-matching='^releaseRuntimeClasspath$'
--fail-on=upgradable
--json-file-output=${{ env.REPORT_FILE }}
--org=radar-base
--policy-path=$PWD/.snyk
- name: Report new vulnerabilities
uses: thehyve/report-vulnerability@master
if: success() || failure()
with:
report-file: ${{ env.REPORT_FILE }}
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
35 changes: 35 additions & 0 deletions .github/workflows/snyk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Snyk test
on:
pull_request:
branches:
- master
- dev

jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: snyk/actions/setup@master
with:
snyk-version: v1.1032.0

- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Run Snyk to check for vulnerabilities
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
run: >
snyk test
--all-sub-projects
--configuration-matching="^runtimeClasspath$"
--fail-on=upgradable
--org=radar-base
--policy-path=.snyk
--severity-threshold=high

0 comments on commit d202583

Please sign in to comment.