-
Notifications
You must be signed in to change notification settings - Fork 1.6k
53 lines (51 loc) · 1.71 KB
/
snyk.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
name: snyk
on:
push:
branches: [master, v2.dev, v3.dev]
permissions: read-all
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
JAVA_VERSION: 21
jobs:
snyk:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
container:
# Incompatible with Harden Runner
image: snyk/snyk:gradle-jdk21
env:
SNYK_INTEGRATION_VERSION: gradle-jdk21
SNYK_INTEGRATION_NAME: GITHUB_ACTIONS
FORCE_COLOR: 2
if: github.event.repository.fork == false
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Gradle
uses: ./.github/actions/run-gradle
with:
java: ${{ env.JAVA_VERSION }}
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
- name: Run Snyk test
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
continue-on-error: true
run: snyk test --sarif-file-output=snyk.sarif --all-sub-projects -- --no-configuration-cache
- name: Check file existence
id: check_files
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
with:
files: snyk.sarif
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
if: steps.check_files.outputs.files_exists == 'true'
with:
sarif_file: snyk.sarif
- name: Run Snyk monitor
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
continue-on-error: true
run: snyk monitor --all-sub-projects -- --no-configuration-cache