From 891aae039eb59878eb37ff00e13323a1e1c0c689 Mon Sep 17 00:00:00 2001 From: ylemkimon Date: Mon, 3 Aug 2020 04:25:17 +0900 Subject: [PATCH] Use base revision provided by CircleCI (#2309) instead of GitHub API Co-authored-by: Kevin Barabash --- .circleci/config.yml | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2ed6cb82..421afc1d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,21 +19,6 @@ commands: command: | git submodule sync git submodule update --init --recursive - - run: - name: Get changed files - command: | - if [[ $CIRCLE_PULL_REQUEST ]]; then - BASE_COMMIT=$(curl -s -H "Authorization: token a61ecb2fc5b72da54431""1b3db3875c96854958a8" \ - https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pulls/$CIRCLE_PR_NUMBER \ - | jq -r ".base.sha | select(. != null)")... - else - BASE_COMMIT=HEAD^ - fi - if [[ $BASE_COMMIT ]]; then - CHANGED=$(git diff --name-only $BASE_COMMIT) - echo "$CHANGED" - echo "export CHANGED=\"$CHANGED\"" >> $BASH_ENV - fi skip_if_only_changed: parameters: @@ -42,7 +27,7 @@ commands: steps: - run: name: Skip tests if only "<< parameters.filter >>" are changed - command: echo "$CHANGED" | grep -qvE '<< parameters.filter >>' || circleci step halt + command: git diff --name-only << pipeline.git.base_revision >>... | grep -qvE '<< parameters.filter >>' || circleci step halt install_dependencies: steps: