Skip to content

Commit 04901d6

Browse files
Fix security scan and keypair.snk
1 parent c85aa3e commit 04901d6

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

.github/workflows/next-gen-ci.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff 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

next-gen/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
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>

0 commit comments

Comments
 (0)