File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -136,11 +136,19 @@ jobs:
136136
137137 - name : Run security scan
138138 run : |
139+ # Run the vulnerability scan and capture output
139140 dotnet list next-gen.sln package --vulnerable --include-transitive --format json > vulnerability-report.json || true
140- if [ -s vulnerability-report.json ] && [ "$(cat vulnerability-report.json)" != "{}" ]; then
141- echo "Vulnerabilities found:"
142- cat vulnerability-report.json
141+
142+ echo "Generated vulnerability report:"
143+ cat vulnerability-report.json
144+
145+ # Check if there are actual vulnerabilities by looking for the vulnerabilities array with content
146+ # The JSON structure includes "vulnerabilities": [...] only when actual vulnerabilities exist
147+ if grep -q '"vulnerabilities":\s*\[[^]]\+\]' vulnerability-report.json; then
148+ echo "Security vulnerabilities detected!"
143149 exit 1
150+ else
151+ echo "No security vulnerabilities found."
144152 fi
145153
146154 - name : Upload vulnerability report
Original file line number Diff line number Diff line change 55 <IsTestProject >$(MSBuildProjectName.Contains('.Test'))</IsTestProject >
66
77 <SignAssembly >true</SignAssembly >
8- <AssemblyOriginatorKeyFile >$(RepoRoot)\KeyPair .snk</AssemblyOriginatorKeyFile >
8+ <AssemblyOriginatorKeyFile >$(MSBuildThisFileDirectory)keyPair .snk</AssemblyOriginatorKeyFile >
99
1010 <Authors >OpenTelemetry Authors</Authors >
1111 <Copyright >Copyright © $([System.DateTime]::Now.ToString(yyyy))</Copyright >
You can’t perform that action at this time.
0 commit comments