Browse Source

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)
pull/3945/head
David Baker 5 years ago
parent
commit
a9a4b1c44e
  1. 17
      scripts/fetch-develop.deps.sh

17
scripts/fetch-develop.deps.sh

@ -6,7 +6,22 @@
# the branch the current checkout is on, use that branch. Otherwise,
# 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() {
org=$1

Loading…
Cancel
Save