I am using NPM audit on my Azure Pipeline build using the following custom command
npm audit --registry=https://registry.npmjs.org/ | Select-String -Pattern ( "Critical") -Context 0,10
The idea here is that I only want to fail this step if there are any critical issues picked up by the audit.
Using this command locally within the command line works fine. But running it as a custom npm command in the pipeline still results in the full npm audit running and returning some moderate errors which cause the step to fail.
I feel I'm missing some formatting on the command but I'm not sure what it is.
Does any one else have experience of using NPM audit in a pipeline while successfully supressing certain error severities?