From a167977904e7dbf6930a50d4bedbb5c9b2424c58 Mon Sep 17 00:00:00 2001 From: Thomas Ardal Date: Tue, 14 May 2024 07:44:59 +0200 Subject: [PATCH] Revert "Switched to elmahio/github-check-vulnerable-nuget-packages-action@v1" This reverts commit 5f97c49ff415f2f941fd59a3af4087ba930e1755. --- .github/workflows/build.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4084087..3b24c87 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,10 +22,20 @@ jobs: 8.0.x - name: Install dependencies run: dotnet restore - - name: Check vulnerable NuGet packages - uses: elmahio/github-check-vulnerable-nuget-packages-action@v1 - with: - project: 'src/Elmah.Io.NLog/Elmah.Io.Nlog.csproj' + - name: Check for vulnerable packages + shell: bash + run: | + set -e # This will cause the script to exit on the first error + OUTPUT=$(dotnet list src/Elmah.Io.NLog/Elmah.Io.Nlog.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