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