Skip to content

Commit

Permalink
Add NugetAudit msbuild settings (#2821)
Browse files Browse the repository at this point in the history
  • Loading branch information
jviau authored Nov 6, 2024
1 parent 4c8db67 commit 87e8056
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,20 @@
<TargetsRoot>$(EngRoot)build/</TargetsRoot>
</PropertyGroup>

<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<PropertyGroup>
<ContinuousIntegrationBuild>false</ContinuousIntegrationBuild>
<ContinuousIntegrationBuild Condition="'$(TF_BUILD)' == 'true'">true</ContinuousIntegrationBuild>
<CI>$(ContinuousIntegrationBuild)</CI>
</PropertyGroup>

<PropertyGroup>
<!-- Nuget audit as warnings only, even in TreatWarningsAsErrors. -->
<!-- Except for in CI, critical will fail the build. -->
<WarningsNotAsErrors>$(WarningsNotAsErrors);NU1901;NU1902;NU1903</WarningsNotAsErrors>
<WarningsNotAsErrors Condition="'$(CI)' == 'false'">$(WarningsNotAsErrors)NU1904</WarningsNotAsErrors>
<WarningsAsErrors Condition="'$(CI)' == 'true'">$(WarningsAsErrors)NU1904</WarningsAsErrors>
<NuGetAuditLevel>moderate</NuGetAuditLevel> <!-- warn on moderate severity only. -->
<NuGetAuditMode>all</NuGetAuditMode> <!-- audit transitive dependencies. -->
</PropertyGroup>

</Project>

0 comments on commit 87e8056

Please sign in to comment.