|
2 | 2 | name: "Security Scan: Snyk Code" |
3 | 3 |
|
4 | 4 | on: |
5 | | - push: |
| 5 | + push: |
6 | 6 |
|
7 | 7 | jobs: |
8 | | - snyk: |
9 | | - runs-on: ubuntu-latest |
| 8 | + snyk: |
| 9 | + runs-on: ubuntu-latest |
10 | 10 |
|
11 | | - strategy: |
12 | | - # see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast |
13 | | - fail-fast: false |
| 11 | + permissions: |
| 12 | + security-events: write |
| 13 | + actions: read |
| 14 | + contents: read |
14 | 15 |
|
15 | | - steps: |
16 | | - - name: Checkout Repository |
17 | | - uses: actions/checkout@v3 |
18 | | - with: |
19 | | - fetch-depth: 1 |
| 16 | + strategy: |
| 17 | + # see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast |
| 18 | + fail-fast: false |
20 | 19 |
|
21 | | - # see https://github.com/snyk/actions/tree/master/node |
22 | | - - name: Lint Code with Snyk |
23 | | - uses: snyk/actions/node@master |
24 | | - env: |
25 | | - # see https://github.com/snyk/actions#getting-your-snyk-token |
26 | | - SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} |
27 | | - with: |
28 | | - # see https://github.com/snyk/actions/tree/master/node#uploading-snyk-scan-results-to-github-code-scanning |
29 | | - args: --policy-path=.snyk --sarif-file-output=snyk.sarif --org=${{ secrets.SNYK_ORG }} |
| 20 | + steps: |
| 21 | + - name: Checkout Repository |
| 22 | + uses: actions/checkout@v3 |
| 23 | + with: |
| 24 | + fetch-depth: 1 |
30 | 25 |
|
31 | | -# # see https://github.com/github/codeql-action/tree/main/upload-sarif |
32 | | -# - name: Upload Snyk IaC results to GitHub Code Scanning |
33 | | -# uses: github/codeql-action/upload-sarif@v2 |
34 | | -# with: |
35 | | -# sarif_file: snyk.sarif |
| 26 | + # see https://github.com/snyk/actions/tree/master/node |
| 27 | + - name: Lint Code with Snyk |
| 28 | + uses: snyk/actions/node@master |
| 29 | + env: |
| 30 | + # see https://github.com/snyk/actions#getting-your-snyk-token |
| 31 | + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} |
| 32 | + with: |
| 33 | + # see https://github.com/snyk/actions/tree/master/node#uploading-snyk-scan-results-to-github-code-scanning |
| 34 | + args: --policy-path=.snyk --sarif-file-output=snyk.sarif --org=${{ secrets.SNYK_ORG }} |
| 35 | + |
| 36 | + # see https://github.com/github/codeql-action/tree/main/upload-sarif |
| 37 | + - name: Upload Snyk IaC results to GitHub Code Scanning |
| 38 | + uses: github/codeql-action/upload-sarif@v2 |
| 39 | + with: |
| 40 | + sarif_file: snyk.sarif |
0 commit comments