mirror of
https://github.com/SchildiChat/element-web.git
synced 2024-10-01 01:26:12 -04:00
Get branch from various CI env vars
So we hopefully get the right branch for PRs from the same repo (but not forks). From @t3chguy's comment (tweaked a bit)
This commit is contained in:
parent
c929cb1337
commit
a9a4b1c44e
@ -6,7 +6,22 @@
|
|||||||
# the branch the current checkout is on, use that branch. Otherwise,
|
# the branch the current checkout is on, use that branch. Otherwise,
|
||||||
# use develop.
|
# use develop.
|
||||||
|
|
||||||
curbranch=`git rev-parse --abbrev-ref HEAD`
|
# Look in the many different CI env vars for which branch we're
|
||||||
|
# building
|
||||||
|
if [[ "$TRAVIS" == true ]]; then
|
||||||
|
curbranch="${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}"
|
||||||
|
else
|
||||||
|
# ghprbSourceBranch for jenkins github pull request builder
|
||||||
|
# GIT_BRANCH for other jenkins builds
|
||||||
|
curbranch="${ghprbSourceBranch:-$GIT_BRANCH}"
|
||||||
|
# Otherwise look at the actual branch we're on
|
||||||
|
if [ -z "$curbranch" ]
|
||||||
|
then
|
||||||
|
curbranch=`git rev-parse --abbrev-ref HEAD`
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Determined branch to be $curbranch"
|
||||||
|
|
||||||
function dodep() {
|
function dodep() {
|
||||||
org=$1
|
org=$1
|
||||||
|
Loading…
Reference in New Issue
Block a user