From 4eff50f5b6979060e7b9e2fb5eb4e6223a473e2b Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Sun, 25 Nov 2018 02:11:09 +0330 Subject: [PATCH] fix(ci): support skip release in commit body --- .circleci/config.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3cb81e9001..08270ee124 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -115,17 +115,16 @@ jobs: - run: name: release command: | - if [[ $GIT_COMMIT_MSG != *"\[skip release\]"* ]]; then + GIT_COMMIT_MSG=`git --no-pager log --pretty=full -n1 $CIRCLE_SHA1` + if echo "$GIT_COMMIT_MSG" | grep -o "\[skip release\]"; then + echo "Release phase is skiped since [skip release] exists in commit message or body." + else echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc echo "//registry.yarnpkg.com/:_authToken=$NPM_TOKEN" >> ~/.npmrc yarn release --yes PACKAGE_SUFFIX=edge yarn build ./scripts/workspace-run npm publish -q - else - echo "Release phase is skiped since [skip release] in commit message." fi - environment: - GIT_COMMIT_MSG: $(git log --format=oneline -n 1 $CIRCLE_SHA1) # Workflow definition workflows: