From c567a4b8f3d81c9e8f8fe6f9795e57d5b57bdcce Mon Sep 17 00:00:00 2001 From: Bruno Barbieri Date: Fri, 6 Jul 2018 14:38:01 -0400 Subject: [PATCH] Check for changes on package-lock.json and exit with error --- .circleci/config.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index e7ce09371..401e3b309 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -108,6 +108,11 @@ jobs: if [ ! -d node_modules ]; then sudo npm install -g npm@6 npm install + # If the package-lock.json has changed, die with an error + CHANGED_FILES="$(git diff --name-only package-lock.json)" + echo "$CHANGED_FILES" | grep --quiet "package-lock.json" && + echo "Looks like package-lock.json has changed. Did you forget to include it on your PR?" && + exit fi - save_cache: key: dependency-cache-{{ checksum "package-lock.json" }}