Skip to content

Commit

Permalink
Create testsnyk
Browse files Browse the repository at this point in the history
  • Loading branch information
thiennn authored Sep 17, 2024
1 parent 2e28b71 commit c20166f
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/testsnyk
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Snyk check
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Run Snyk test
uses: snyk/actions/dotnet@master
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
command: test --sarif
args: --sarif-file-output=snyk_test.sarif
- name: Run Snyk code test
uses: snyk/actions/dotnet@master
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
command: code test --sarif
args: --sarif-file-output=snyk_code_test.sarif
- name: Run Snyk monitor
uses: snyk/actions/dotnet@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
command: monitor
- name: Create SARIF directory and move SARIF files
run: |
mkdir sarif_files &&
mv snyk_test.sarif snyk_code_test.sarif sarif_files/
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: sarif_files

0 comments on commit c20166f

Please sign in to comment.