git rev-parse --short HEAD
, we end up getting the merge commit SHA instead of most recent commit SHA of the pull request.TRAVIS_BRANCH
but also TRAVIS_PULL_REQUEST_BRANCH
TRAVIS_BRANCH
:
for push builds, or builds not triggered by a pull request, this is the name of the branch. for builds triggered by a pull request this is the name of the branch targeted by the pull request.
TRAVIS_PULL_REQUEST_BRANCH
:
if the current job is a pull request, the name of the branch from which the PR originated. if the current job is a push build, this variable is empty (""
).