Open u2mejc opened 2 months ago
I think this might be that the support of this flag was always naive - it's being passed to npm audit and so it doesn't report stuff on that level. I'll need to dive deeper to figure out if that idea is right.
Ping me again if I'm not reporting progress ;)
Will do, thank you for the rapid reply! 🚀
It may be because the report output of npm audit
is not changed by the option --audit-level
, it only changes the exit code:
https://docs.npmjs.com/cli/commands/npm-audit#description
By default, the audit command will exit with a non-zero code if any vulnerability is found. It may be useful in CI environments to include the --audit-level parameter to specify the minimum vulnerability level that will cause the command to fail. This option does not filter the report output, it simply changes the command's failure threshold.
First, thank you for your hard work, it's very appreciated! 🤗
Issue: We're setting up a CI env to automatically run
check-audit
, and we're setting the--audit-level
(or alternatively the envnpm_config_audit_level
), but if we skip any vulnerabilities inresolve-audit
, the exit code still returns a non zero for vulnerabilities below the audit-level. It seems the NPM exit code is being persisted, even though there is an existingaudit-resolve.json
.It's mentioned this is supported in #22 so I'm not sure if I'm doing it wrong, but I've tried multiple times.
Expected Result:
check-audit
should only fail on vulnerabilities equal to or greater than the desired audit level, that do not have a current decisions in the audit-resolve.json file.Repoduce: