From 13801b6a0eb788aeb98a374ffab5df8e1db883ae Mon Sep 17 00:00:00 2001 From: divious1 Date: Fri, 15 Jan 2021 11:14:47 -0500 Subject: [PATCH] fixed bug where it did not checkout external branches --- .circleci/config.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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