Skip to content

Commit ff09a6d

Browse files
mgolKrinkle
andauthored
P:builder: Don't run npm update or npm prune, run npm ci
Changes: 1. Use `npm ci` in favor of `npm install` 2. Don't run `npm update` or `npm prune`. The latter is unnecessary, and the former is breaking the build when new incompatible dependencies come out. Also, just blindly updating everything to the latest version makes us more vulnerable to supply chain attacks in our dependencies. Closes gh-78 Co-authored-by: Timo Tijhof <[email protected]>
1 parent 4535bf1 commit ff09a6d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

modules/profile/files/builder/builder-do-update.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ trap cleanup EXIT
1111
export NODE_ENV=production
1212

1313
cd "$1"
14-
npm install
15-
npm update
16-
npm prune
14+
if [ -e 'package-lock.json' ] || [ -e 'npm-shrinkwrap.json' ]; then
15+
npm ci
16+
else
17+
npm install
18+
fi
1719

1820
GRUNT="node_modules/.bin/grunt"
1921
SERVERS="$(cat /etc/builder-wordpress-hosts)"

0 commit comments

Comments
 (0)