Commit fb7e8f6f authored by SBassett's avatar SBassett
Browse files

* One last attempt at echoing newlines in gitlab ci console output

* Re-work logic for npm audit options variable checks
parent da3a63e1
Pipeline #1388 passed with stage
in 50 seconds
......@@ -12,8 +12,8 @@ npm_audit_dependency_check:
- npm install -g audit-ci
- |
# check if alternative npm audit options were specified calling gitlab-ci.yml file
if [ -z "$WM_APPSEC_NPM_AUDIT_OPTIONS" ]; then
WM_APPSEC_NPM_AUDIT_OPTIONS=${NPM_AUDIT_OPTIONS}
if [ ! -z "$WM_APPSEC_NPM_AUDIT_OPTIONS" ]; then
NPM_AUDIT_OPTIONS="$WM_APPSEC_NPM_AUDIT_OPTIONS"
fi
script:
......@@ -27,18 +27,18 @@ npm_audit_dependency_check:
npm_dir="$(dirname "$f")"
cd $root_dir/$npm_dir
npm install --package-lock-only
echo -e "\n"
echo -e "\n "
echo -e "----- $f -----"
echo -e "\n"
echo -e "\n "
set -e
EXIT_CODE=0
audit-ci ${WM_APPSEC_NPM_AUDIT_OPTIONS} || EXIT_CODE=$?
audit-ci "$NPM_AUDIT_OPTIONS" || EXIT_CODE=$?
TOTAL_EXIT_CODES=$(($TOTAL_EXIT_CODES + $EXIT_CODE))
done
if [ "$TOTAL_EXIT_CODES" -gt 0 ]; then
echo -e "\n"
echo -e "\n "
echo -e "At least one package.json file contained vulnerable dependencies, please review."
echo -e "\n"
echo -e "\n "
exit 1
fi
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment