-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce Snyk vulnerability scanner (#114)
- Loading branch information
1 parent
bc9aaaa
commit 0002d4e
Showing
1 changed file
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: '🐕🦺 Snyk: Vulnerability Analysis' | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'src/**' | ||
- '!src/qodana.yml' | ||
- '.github/workflows/snyk.yml' | ||
types: [opened, synchronize, reopened] | ||
push: | ||
branches: | ||
- 'master' | ||
paths: | ||
- 'src/**' | ||
- '!src/qodana.yml' | ||
- '.github/workflows/snyk.yml' | ||
schedule: | ||
- cron: '14 6 * * 0' # Random time | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
snyk: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
steps: | ||
- name: 📥 checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: 🏗️ restore dependencies | ||
run: dotnet restore ./src/Objectivity.AutoFixture.XUnit2.AutoMock.sln | ||
- name: 🔬 snyk scan | ||
uses: snyk/actions/dotnet@master | ||
continue-on-error: true | ||
env: | ||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | ||
with: | ||
args: --sarif-file-output=snyk.sarif --file=src/Objectivity.AutoFixture.XUnit2.AutoMock.sln | ||
- name: 📈 snyk monitor | ||
uses: snyk/actions/dotnet@master | ||
env: | ||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | ||
with: | ||
args: --file=src/Objectivity.AutoFixture.XUnit2.AutoMock.sln | ||
command: monitor | ||
- name: 📊 upload SARIF file for GitHub Advanced Security Dashboard | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: snyk.sarif | ||
if: ${{ always() }} |