diff --git a/.circleci/config.yml b/.circleci/config.yml index 967a136215..d594168494 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -201,7 +201,12 @@ jobs: - run: name: checkout repo command: | - if [ "${CIRCLE_BRANCH}" == "" ]; then + if [[ ! -z "${CIRCLE_PULL_REQUEST}" && ! -z "${CIRCLE_PR_NUMBER}" ]]; then + git clone https://${GITHUB_TOKEN}@github.com/splunk/security-content.git + cd security-content + git fetch origin pull/${CIRCLE_PR_NUMBER}/head:${CIRCLE_BRANCH} + git checkout ${CIRCLE_BRANCH} + elif [ "${CIRCLE_BRANCH}" == "" ]; then git clone https://${GITHUB_TOKEN}@github.com/splunk/security-content.git else git clone --branch ${CIRCLE_BRANCH} https://${GITHUB_TOKEN}@github.com/splunk/security-content.git