diff --git a/.github/workflows/dotnet-snyk.yml b/.github/workflows/snyk-code.yml similarity index 66% rename from .github/workflows/dotnet-snyk.yml rename to .github/workflows/snyk-code.yml index f338cb2..98f9440 100644 --- a/.github/workflows/dotnet-snyk.yml +++ b/.github/workflows/snyk-code.yml @@ -5,7 +5,7 @@ --- -name: .NET Snyk Code analysis +name: Snyk Code analysis (.NET) on: # yamllint disable-line rule:truthy push: @@ -16,19 +16,19 @@ on: # yamllint disable-line rule:truthy jobs: security: runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write steps: - uses: actions/checkout@master - uses: snyk/actions/setup@master - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: 8.0.x - - 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-test/ + snyk code 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'