From a7949173e00d40b4a50d51ded2a6b3cdf45bfb57 Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Wed, 20 Jan 2021 13:08:51 -0800 Subject: [PATCH] devops: always check git status before publishing to npm (#5070) --- utils/publish_all_packages.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/utils/publish_all_packages.sh b/utils/publish_all_packages.sh index e654b3f477..46c7310afb 100755 --- a/utils/publish_all_packages.sh +++ b/utils/publish_all_packages.sh @@ -44,11 +44,12 @@ cd .. NPM_PUBLISH_TAG="next" VERSION=$(node -e 'console.log(require("./package.json").version)') +if [[ -n $(git status -s) ]]; then + echo "ERROR: git status is dirty; some uncommitted changes or untracked files" + exit 1 +fi + if [[ $1 == "--release" ]]; then - if [[ -n $(git status -s) ]]; then - echo "ERROR: git status is dirty; some uncommitted changes or untracked files" - exit 1 - fi # Ensure package version does not contain dash. if [[ "${VERSION}" == *-* ]]; then echo "ERROR: cannot publish pre-release version with --release flag"