-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (54 loc) · 2.07 KB
/
pr_and_main.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
name: "Snyk scan"
on:
pull_request:
push:
branches:
- main
jobs:
snyk_scan_deps_licences:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Run Snyk to check for deps vulnerabilities
uses: snyk/actions/gradle-jdk17@b98d498629f1c368650224d6d212bf7dfa89e4bf # v0.4.0
with:
args: --all-projects --org=${{ secrets.SNYK_ORG_ID }} --severity-threshold=high
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
snyk_scan_code:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Run Snyk to check for code vulnerabilities
uses: snyk/actions/gradle-jdk17@b98d498629f1c368650224d6d212bf7dfa89e4bf # v0.4.0
with:
args: --all-projects --org=${{ secrets.SNYK_ORG_ID }} --severity-threshold=high
command: code test
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
snyk_sbom:
runs-on: ubuntu-latest
needs:
- snyk_scan_deps_licences
- snyk_scan_code
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Generate SBOM # check SBOM can be generated but nothing is done with it
uses: snyk/actions/gradle-jdk17@b98d498629f1c368650224d6d212bf7dfa89e4bf # v0.4.0
with:
args: --all-projects --org=${{ secrets.SNYK_ORG_ID }} --format=cyclonedx1.4+json --json-file-output sbom.json
command: sbom
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
snyk_online_monitor:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Enable Snyk online monitoring to check for vulnerabilities
uses: snyk/actions/gradle-jdk17@b98d498629f1c368650224d6d212bf7dfa89e4bf # v0.4.0
with:
args: --all-projects --org=${{ secrets.SNYK_ORG_ID }}
command: monitor
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}