From: Kees Hoekzema Date: Fri, 10 May 2019 09:18:23 +0000 (+0200) Subject: fix PR checkout in circle-ci testing X-Git-Tag: rec-4.2.0-rc1~24^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F7805%2Fhead;p=thirdparty%2Fpdns.git fix PR checkout in circle-ci testing --- 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