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