Skip to content

Commit 6deeed2

Browse files
authored
LDP-1056: Handle getting git branch on Cloudflare. (#47)
Co-authored-by: Petar <petar.basic@drunomics.com>
1 parent f114a89 commit 6deeed2

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

scripts/util/get-branch.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ if [[ $GIT_CURRENT_BRANCH == "HEAD" ]]; then
2323
if [[ ! -z "$TRAVIS" ]] && [[ "$GIT_BRANCH" == "HEAD" ]]; then
2424
GIT_BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
2525
fi
26+
# On Cloudflare pages, fall back to the CF git branch.
27+
if [[ ! -z "$CF_PAGES" ]] && [[ "$GIT_BRANCH" == "HEAD" ]]; then
28+
GIT_BRANCH=$CF_PAGES_BRANCH
29+
fi
2630

2731
GIT_CURRENT_BRANCH=tmp/$(date +%s)
2832
git checkout -b $GIT_CURRENT_BRANCH

0 commit comments

Comments
 (0)