Skip to content

fix(audit): respect --level flag for exit code - #31721

Merged
bartlomieju merged 3 commits into
denoland:mainfrom
majiayu000:fix/issue-31702-audit-exit-code
Jan 15, 2026
Merged

bartlomieju merged 3 commits into
denoland:mainfrom
majiayu000:fix/issue-31702-audit-exit-code

Conversation

@majiayu000

Copy link
Copy Markdown
Contributor

Summary

  • Exit code now depends on whether vulnerabilities meet the --level threshold
  • Matches npm's audit exit code behavior as documented here
  • Added tests to verify the behavior

Closes #31702

majiayu000 and others added 2 commits December 26, 2025 12:04
The exit code now depends on whether there are vulnerabilities at or
above the specified severity level, matching npm's behavior.

- Exit 0 when no vulnerabilities meet the threshold
- Exit 1 only when vulnerabilities at or above --level exist

Closes denoland#31702

Signed-off-by: majiayu000 <[email protected]>

@bartlomieju bartlomieju left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@bartlomieju
bartlomieju enabled auto-merge (squash) January 15, 2026 09:13
@bartlomieju
bartlomieju merged commit 04e93df into denoland:main Jan 15, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve the deno audit exit code

2 participants