Skip to content

Commit

Permalink
Added check for vulnerable packages to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasArdal committed May 3, 2024
1 parent 90d7197 commit 45d81dc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/dotnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ jobs:
- name: Install dependencies
run: dotnet restore

- name: Check for vulnerable packages
run: |
set -e # This will cause the script to exit on the first error
OUTPUT=$(dotnet list package --vulnerable)
echo "$OUTPUT"
if echo "$OUTPUT" | grep -q 'no vulnerable packages'; then
echo "No vulnerable packages found"
else
if echo "$OUTPUT" | grep -q 'vulnerable'; then
echo "Vulnerable packages found"
exit 1
fi
fi
- name: Build
run: dotnet build --configuration Release --no-restore

Expand Down

0 comments on commit 45d81dc

Please sign in to comment.