Skip to content

Commit

Permalink
LDP-1056: Handle getting git branch on Cloudflare. (#47)
Browse files Browse the repository at this point in the history
Co-authored-by: Petar <[email protected]>
  • Loading branch information
petarbasic and petarbasic authored Apr 28, 2022
1 parent f114a89 commit 6deeed2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/util/get-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ if [[ $GIT_CURRENT_BRANCH == "HEAD" ]]; then
if [[ ! -z "$TRAVIS" ]] && [[ "$GIT_BRANCH" == "HEAD" ]]; then
GIT_BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
fi
# On Cloudflare pages, fall back to the CF git branch.
if [[ ! -z "$CF_PAGES" ]] && [[ "$GIT_BRANCH" == "HEAD" ]]; then
GIT_BRANCH=$CF_PAGES_BRANCH
fi

GIT_CURRENT_BRANCH=tmp/$(date +%s)
git checkout -b $GIT_CURRENT_BRANCH
Expand Down

0 comments on commit 6deeed2

Please sign in to comment.