-
Notifications
You must be signed in to change notification settings - Fork 8
51 lines (42 loc) · 1.34 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
name: Snyk Scan and SARIF Upload
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
snyk_scan:
name: Snyk Scan
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install Node.js and Snyk CLI
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install Snyk CLI
run: npm install -g snyk
- name: Authenticate Snyk
run: snyk auth ${{ secrets.SNYK_TOKEN }}
- name: Run Snyk to check configuration files for security issues
continue-on-error: true
run: |
snyk iac test --sarif-file-output=snyk.sarif --json-file-output=snyk.json
echo "Snyk command completed"
echo "Listing current directory contents:"
ls -alh
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
- name: Verify Snyk Results SARIF
run: |
echo "Checking if snyk.sarif file exists:"
ls -l snyk.sarif
cat snyk.sarif # Display contents of the JSON file for debugging
- name: Upload SARIF File
if: success() || failure() # Ensure SARIF upload runs regardless of the previous step's success/failure
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: snyk.sarif