From 14034060d759fce61ca065bdff65e78cd40c6bb2 Mon Sep 17 00:00:00 2001 From: Robert Dailey Date: Wed, 19 Oct 2022 09:28:50 -0500 Subject: [PATCH] ci: New github workflow for Snyk --- .github/workflows/snyk.yml | 53 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/snyk.yml diff --git a/.github/workflows/snyk.yml b/.github/workflows/snyk.yml new file mode 100644 index 00000000..d7d0e3d5 --- /dev/null +++ b/.github/workflows/snyk.yml @@ -0,0 +1,53 @@ +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +name: Snyk + +on: + push: + paths: + - .github/workflows/snyk.yml + - "**.cs" + - "**.props" + - "**.sln" + - "**.csproj" + pull_request: + paths: + - .github/workflows/snyk.yml + - "**.cs" + - "**.props" + - "**.sln" + - "**.csproj" + +jobs: + snyk: + name: Snyk + runs-on: ubuntu-latest + steps: + - name: Get Source Code + uses: actions/checkout@v2 + with: + fetch-depth: 0 # avoid shallow clone for GitVersion + + - name: dotnet restore + run: dotnet restore src + + - name: Snyk Test + uses: snyk/actions/dotnet@master + continue-on-error: true + env: + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} + with: + args: --sarif-file-output=snyk.sarif --file=src/Recyclarr.sln + + - name: Snyk Monitor + uses: snyk/actions/dotnet@master + continue-on-error: true + env: + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} + with: + command: monitor + args: --file=src/Recyclarr.sln + + - name: Publish to Github CS + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: snyk.sarif