From fa034ebbc506135afbdba7c65773de4e1c75cc3c Mon Sep 17 00:00:00 2001 From: Zak Timson Date: Tue, 3 May 2022 18:35:20 +0000 Subject: [PATCH] Update .gitlab/.gitlab-ci.yml file --- .gitlab/.gitlab-ci.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index e751a1d..82df380 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -40,9 +40,11 @@ audit: - node_modules policy: pull script: - - echo "vulnerabilities_high $(npm audit | grep -oE '[0-9]+ high' | grep -oE '[0-9]+' || echo 0)" > metrics.txt - - echo "vulnerabilities_medium $(npm audit | grep -oE '[0-9]+ moderate' | grep -oE '[0-9]+' || echo 0)" >> metrics.txt - - echo "vulnerabilities_low $(npm audit | grep -oE '[0-9]+ low' | grep -oE '[0-9]+' || echo 0)" >> metrics.txt + - AUDIT=$(npm audit) + - echo "vulnerabilities_high $(echo $AUDIT | grep -oE '[0-9]+ high' | grep -oE '[0-9]+' || echo 0)" > metrics.txt + - echo "vulnerabilities_medium $(echo $AUDIT | grep -oE '[0-9]+ moderate' | grep -oE '[0-9]+' || echo 0)" >> metrics.txt + - echo "vulnerabilities_low $(echo $AUDIT | grep -oE '[0-9]+ low' | grep -oE '[0-9]+' || echo 0)" >> metrics.txt + - echo "$AUDIT" artifacts: reports: metrics: metrics.txt @@ -80,6 +82,7 @@ tag: - git push -f origin $VERSION rules: - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' + allow_failure: true production: stage: deploy