forked from mirrors/thatmattlove-hyperglass
Fixed issue with branch detection for PRs
This commit is contained in:
parent
f5c778d787
commit
6431f9a751
1 changed files with 22 additions and 1 deletions
|
|
@ -1,6 +1,27 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
echo "Travis thinks the branch is $TRAVIS_BRANCH"
|
||||||
git config --global user.email "travis@travis-ci.org"
|
git config --global user.email "travis@travis-ci.org"
|
||||||
git config --global user.name "Travis CI"
|
git config --global user.name "Travis CI"
|
||||||
git checkout $TRAVIS_BRANCH
|
git checkout $TRAVIS_BRANCH
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
|
||||||
|
git_setup() {
|
||||||
|
git config user.email "travis@travis-ci.org"
|
||||||
|
git config user.name "Travis CI"
|
||||||
|
}
|
||||||
|
|
||||||
|
detect_branch() {
|
||||||
|
if [ "$TRAVIS_PULL_REQUEST" = "true" ]; then
|
||||||
|
echo $TRAVIS_PULL_REQUEST_BRANCH
|
||||||
|
else
|
||||||
|
echo $TRAVIS_BRANCH
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
CURRENT_BRANCH=$(detect_branch)
|
||||||
|
|
||||||
|
git_setup
|
||||||
|
git checkout $CURRENT_BRANCH
|
||||||
|
export $CURRENT_BRANCH
|
||||||
|
exit 0
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue