Set proper exit code on dotnet list package --vulnerable
to enable usage in CI pipelines #16852
Description
Running dotnet list package --vulnerable
does not use the exit code to indicate issues. I'd think vulnerable packages with medium / high severity would at least be returned with an exitcode <> 0.
Usage example:
I want to include this command in our CI pipeline to enable a shift left mentality and warn us earlier about possible vulnerabilities. Currently the only option I see is parsing the result for something like has the following vulnerable packages
.
Alternatively I can image adding a parameter to return either a number of vulnerable packages (that we can then test to larger then 0) or a json object we can parse the right way to look for the numbers per severity.
I've been searching the source code but could not find where to look for the exit code setup 😁 .
Activity