From 45bf1dc142f811fd98816ff749d3c03e8313fb71 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 25 Jan 2018 13:42:49 -0800 Subject: [PATCH] CI Build: Use TRAVIS_PULL_REQUEST_SHA to accurately get the commit message (#6024) --- tools/travis.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/travis.ps1 b/tools/travis.ps1 index 8976c57ec6..9e4795d970 100644 --- a/tools/travis.ps1 +++ b/tools/travis.ps1 @@ -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 {