Hey, devopses / linux-users / pipelines-developers! I need to develop my bitbucket pipeline with NPM auditing steps: one regular with stopping pipeline if error, and second that do not stop pipeline event with error from "npm audit". For now I did smth like this but doesn't try it yet and I'm thinking if this audit-step-prod could event work (don't know exactly if it work on my local arch-linux machine):
```yaml
- step: &audit-step-dev
name: 'Pull request - audit'
caches:
- node
script:
- npm install
- npm audit
- step: &audit-step-prod
name: 'Pull request - soft audit'
caches:
- node
script:
- npm install
- |
set +e
npm audit
if [[ $? -gt 0 ]]; then echo "NPM Audit failed, fix dependencies before next merge!"; else echo "NPM Audit OK"; fi
set -e
```
#bash #linux #pipeline #bitbucket #npm