summaryrefslogtreecommitdiff
path: root/.github/workflows/setup_git.sh
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/setup_git.sh')
-rwxr-xr-x.github/workflows/setup_git.sh9
1 files changed, 4 insertions, 5 deletions
diff --git a/.github/workflows/setup_git.sh b/.github/workflows/setup_git.sh
index bd79daf268..e319e07512 100755
--- a/.github/workflows/setup_git.sh
+++ b/.github/workflows/setup_git.sh
@@ -1,9 +1,8 @@
#!/usr/bin/env sh
git config --global user.email "spack@example.com"
git config --global user.name "Test User"
-# With fetch-depth: 0 we have a remote develop
-# but not a local branch. Don't do this on develop
-if [ "$(git branch --show-current)" != "develop" ]
-then
- git branch develop origin/develop
+
+# create a local pr base branch
+if [[ -n $GITHUB_BASE_REF ]]; then
+ git fetch origin "${GITHUB_BASE_REF}:${GITHUB_BASE_REF}"
fi