Skip to content

[CONFIG] [Github-Actions] Snyk Open Source. Modified. Sarif output en… #3

[CONFIG] [Github-Actions] Snyk Open Source. Modified. Sarif output en…

[CONFIG] [Github-Actions] Snyk Open Source. Modified. Sarif output en… #3

Workflow file for this run

# yamllint disable rule:line-length
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
# yamllint enable rule:line-length
---
name: Snyk Code analysis (.NET)
on: # yamllint disable-line rule:truthy
push:
branches: ["main", "develop", "feature/*"]
pull_request:
branches: ["main"]
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: snyk/actions/setup@master
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.4
- name: Restore dependencies
run: dotnet restore algorithm-exercises-csharp.sln
- name: Run Snyk to check for vulnerabilities
run: >
snyk test
algorithm-exercises-csharp/
algorithm-exercises-csharp-base/
algorithm-exercises-csharp-test/
--sarif-file-output=snyk-code.sarif
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'snyk-code.sarif'