Skip to content

Set proper exit code on dotnet list package --vulnerable to enable usage in CI pipelines #16852

Closed
@rajbos

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Area-NuGetcli-uxIssues and PRs that deal with the UX of the CLI (exit codes, log output, verbs/options, and so on)untriagedRequest triage from a team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions