Skip to content

Commit

Permalink
chore: add quality gates using snyk actions (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
cvaidas authored Jul 19, 2024
1 parent 7f2f7c7 commit c3cb1cc
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/pr-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,38 @@ env:
DEFAULT_BRANCH: main

jobs:
security-open-source-scan:
runs-on: ubuntu-latest
environment: snyk-msbuild-envs
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
- name: Restore dependencies
run: dotnet restore /home/runner/work/snyk-visual-studio-plugin/snyk-visual-studio-plugin
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/dotnet@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
command: test
args:
--all-projects
--exclude=Snyk.VisualStudio.Extension.Tests,Snyk.Common.Tests,Snyk.Code.Library.Tests,Tests
--severity-threshold=high
security-code-scan:
runs-on: ubuntu-latest
environment: snyk-msbuild-envs
steps:
- uses: actions/checkout@v4
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/dotnet@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
command: code test
args:
--severity-threshold=high
build-project:
uses: snyk/snyk-visual-studio-plugin/.github/workflows/build-project.yml@main
with:
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/security-scan-upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Security Scan Upload

on:
push:
branches:
- main

jobs:
security-open-source-monitor:
runs-on: ubuntu-latest
environment: snyk-msbuild-envs
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
- name: Restore dependencies
run: dotnet restore /home/runner/work/snyk-visual-studio-plugin/snyk-visual-studio-plugin
- name: Run snyk monitor
uses: snyk/actions/dotnet@master
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
command: monitor
args:
--all-projects
--exclude=Snyk.VisualStudio.Extension.Tests,Snyk.Common.Tests,Snyk.Code.Library.Tests,Tests
security-code-monitor:
runs-on: ubuntu-latest
environment: snyk-msbuild-envs
steps:
- uses: actions/checkout@v4
- name: Run snyk monitor
uses: snyk/actions/dotnet@master
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
command: code test
args:
--report
--project-name="snyk/${{ github.event.repository.name }}"
6 changes: 6 additions & 0 deletions .snyk
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.25.0
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
exclude:
global:
#Exclude test directory for snyk code scan
- Snyk.Code.Library.Tests
- Snyk.Common.Tests
- Snyk.VisualStudio.Extension.Tests
ignore:
SNYK-DOTNET-NEWTONSOFTJSON-2774678:
- '*':
Expand Down

0 comments on commit c3cb1cc

Please sign in to comment.