From 9b25d39ada52711848570d7f3924908ccdac45c2 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Sat, 18 Aug 2018 20:12:43 +0200 Subject: [PATCH] [test] fix empty CIRCLE_COMPARE_URL --- .circleci/config.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bcb3c0afec465b..3542b34fc7a31d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,11 +49,16 @@ jobs: - checkout - *restore_repo - run: - name: Check if yarn prettier was run + name: Export COMMIT_RANGE command: | # commit range between master and branch # CIRCLE_COMPARE_URL=https://github.com/org/repo/compare/sha1...sha1 - COMMIT_RANGE=$(grep -oP "\w+\.\.\.\w+" <<< "$CIRCLE_COMPARE_URL") + # https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-shell-command + echo 'export COMMIT_RANGE=$(grep -oP "\w+\.\.\.\w+" <<< "$CIRCLE_COMPARE_URL")' >> $BASH_ENV + source $BASH_ENV + - run: + name: Check if yarn prettier was run + command: | # Files changed on this branch CHANGED_FILES=$(git diff --name-only "$COMMIT_RANGE") # if we use an empty string as a pattern grep will match everything