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 f8282d3 commit f9ea4ca
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ jobs:
8.0.x
- 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 src/Elmah.Io.Functions/Elmah.Io.Functions.csproj 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
- name: Test
Expand Down

0 comments on commit f9ea4ca

Please sign in to comment.