CI Build: Use TRAVIS_PULL_REQUEST_SHA to accurately get the commit message (#6024)

This commit is contained in:
Dongbo Wang
2018-01-25 13:42:49 -08:00
committed by GitHub
parent 875a12d3d1
commit 45bf1dc142
+3 -3
View File
@@ -157,9 +157,9 @@ $isPR = $env:TRAVIS_EVENT_TYPE -eq 'pull_request'
# For PRs, Travis-ci strips out [ and ] so read the message directly from git
if($env:TRAVIS_EVENT_TYPE -eq 'pull_request')
{
# Get the second log entry body
# The first log is a merge for a PR
$commitMessage = git log --format=%B -n 1 --skip=1
# If the current job is a pull request, the env variable 'TRAVIS_PULL_REQUEST_SHA' contains
# the commit SHA of the HEAD commit of the PR.
$commitMessage = git log --format=%B -n 1 $env:TRAVIS_PULL_REQUEST_SHA
}
else
{