Merge pull request #1104 from splunk/allow_external_prs

fixed bug where it did not checkout external branches
This commit is contained in:
Bhavin Patel
2021-01-15 12:37:51 -08:00
committed by GitHub
+6 -1
View File
@@ -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