Commit 2e306338 authored by SBassett's avatar SBassett
Browse files

Hopefully this works now given type in calling gitlab-ci.yml :/

parent b01c1170
Pipeline #1407 passed with stage
in 47 seconds
npm_audit_dependency_check:
image: docker-registry.wikimedia.org/$WM_APPSEC_NPM_IMAGE
image: docker-registry.wikimedia.org/${WM_APPSEC_NPM_IMAGE}
stage: test
allow_failure: false
variables:
# default secteam npm audit options
NPM_AUDIT_OPTIONS: ${WM_APPSEC_NPM_AUDIT_OPTIONS}
NPM_AUDIT_OPTIONS: "--moderate=true --skip-dev=true --report=true"
before_script:
- apt-get update -yqq && apt-get install -yqq git
- 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
NPM_AUDIT_OPTIONS=${WM_APPSEC_NPM_AUDIT_OPTIONS}
fi
script:
- |
......@@ -17,11 +22,6 @@ npm_audit_dependency_check:
file_list=$(git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHA -- \
{*package.json,*package-lock.json,*/package.json,*/package-lock.json})
# check if alternative npm audit options were specified calling gitlab-ci.yml file
#if [ ! -z $WM_APPSEC_NPM_AUDIT_OPTIONS ]; then
# NPM_AUDIT_OPTIONS=$WM_APPSEC_NPM_AUDIT_OPTIONS
#fi
# find all modified package.json files and run audit-ci against them
TOTAL_EXIT_CODES=0
for f in $file_list; do
......
Markdown is supported
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