forked from mirrors/thatmattlove-hyperglass
Evaluate PR state & set branch to commit accordingly
This commit is contained in:
parent
fc3b7bb12c
commit
5b1c327b7f
1 changed files with 22 additions and 0 deletions
22
tests/ci_git_prep.sh
Normal file
22
tests/ci_git_prep.sh
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#!/bin/sh
|
||||
|
||||
THIS_BRANCH=0
|
||||
|
||||
git_setup() {
|
||||
git config --global user.email "travis@travis-ci.org"
|
||||
git config --global user.name "Travis CI"
|
||||
}
|
||||
|
||||
set_branch() {
|
||||
if [ "$TRAVIS_PULL_REQUEST" = "true" ]; then
|
||||
THIS_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH
|
||||
else
|
||||
THIS_BRANCH='master'
|
||||
fi
|
||||
}
|
||||
|
||||
git_setup
|
||||
git fetch
|
||||
set_branch
|
||||
git checkout $THIS_BRANCH
|
||||
exit 0
|
||||
Loading…
Add table
Reference in a new issue