From 2045291c73e69d06e1ebc7b224344b45f88d7265 Mon Sep 17 00:00:00 2001 From: Kees Hoekzema Date: Fri, 10 May 2019 11:18:23 +0200 Subject: [PATCH] fix PR checkout in circle-ci testing --- .circleci/config.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1f86d52ead..aee0e8c423 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,7 +12,19 @@ commands: command: mkdir -p $HOME/.ssh && ssh-keyscan $(echo ${CIRCLE_REPOSITORY_URL} | sed 's,.*@\([^:]*\):.*,\1,') > $HOME/.ssh/known_hosts - run: name: Clone the repo - command: git clone --depth 1 --branch $CIRCLE_BRANCH $CIRCLE_REPOSITORY_URL ~/project + command: | + if [ -n "$CIRCLE_PR_NUMBER" ] + then + echo === Checking out PR "$CIRCLE_PR_NUMBER" from "$CIRCLE_REPOSITORY_URL" + git clone --depth 1 $CIRCLE_REPOSITORY_URL ~/project + cd ~/project + git fetch --depth 1 origin +refs/pull/${CIRCLE_PR_NUMBER}/merge + git checkout -qf FETCH_HEAD + else + echo === Checking out branch "${CIRCLE_BRANCH}" from "$CIRCLE_REPOSITORY_URL" + git clone --depth 1 --branch $CIRCLE_BRANCH $CIRCLE_REPOSITORY_URL ~/project + fi + git show -s auth-regress-setup: description: Prepare the environment for auth regression tests -- 2.47.2