From 88d9a3b440e655f046824f9b98100d29625568aa Mon Sep 17 00:00:00 2001 From: Dominik Prokop Date: Mon, 15 Jul 2019 16:56:49 +0200 Subject: [PATCH] Build: detect changes to packages based on the git diff (#18118) --- scripts/circle-release-next-packages.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/circle-release-next-packages.sh b/scripts/circle-release-next-packages.sh index ad15078f49f..6030eab23d1 100755 --- a/scripts/circle-release-next-packages.sh +++ b/scripts/circle-release-next-packages.sh @@ -19,8 +19,10 @@ GIT_SHA=$(parse_git_hash) echo "Commit: ${GIT_SHA}" echo "Current lerna.json version: ${PACKAGE_VERSION}" -# count packages that changed -count=`npx lerna changed --loglevel silent | awk '{c++} END {print c}'` +# check if there were any changes to packages between current and previous commit +count=`git diff HEAD~1..HEAD --name-only -- packages | awk '{c++} END {print c}'` + + if [ -z $count ]; then echo "No changes in packages, skipping packages publishing"