File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4141 persist-credentials : false
4242
4343 - name : Report vulnerable dependencies
44- run : dotnet restore ${{ env.SOLUTION_FILE }} /p:Configuration=Release /p:NuGetAudit=true /p:NuGetAuditMode=all /p:NuGetAuditLevel=low --verbosity minimal
44+ shell : pwsh
45+ run : |
46+ $ErrorActionPreference = 'Stop'
47+ $PSNativeCommandUseErrorActionPreference = $true
48+
49+ $output = dotnet list ${{ env.SOLUTION_FILE }} package --vulnerable --include-transitive --format json --output-version 1 2>&1
50+ $text = ($output | Out-String).TrimEnd()
51+ $json = $text | ConvertFrom-Json
52+
53+ foreach ($project in $json.projects) {
54+ if ($project.frameworks) {
55+ Write-Host 'Vulnerable package references were found.'
56+ dotnet list ${{ env.SOLUTION_FILE }} package --vulnerable --include-transitive
57+ exit 1
58+ }
59+ }
You can’t perform that action at this time.
0 commit comments