Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Add merge commit detection
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoabreu committed Sep 20, 2018
1 parent d724c8c commit 4320d32
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ci/Jenkinsfile_utils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,15 @@ echo ${libs} | sed -e 's/,/ /g' | xargs md5sum

def publish_test_coverage() {
// CodeCovs auto detection has trouble with our CIs PR validation due the merging strategy
lastCommitMessage = sh (script: "git log -1 --pretty=%B", returnStdout: true)
if (lastCommitMessage.startsWith("Merge commit '") && lastCommitMessage.endsWith("' into HEAD")) {
// Merge commit applied by Jenkins, skip that commit
GIT_COMMIT_HASH = sh (script: "git rev-parse @~", returnStdout: true)
} else {
GIT_COMMIT_HASH = sh (script: "git rev-parse @", returnStdout: true)
}

def codecovArgs = ""
GIT_COMMIT_HASH = sh (script: "git rev-parse @", returnStdout: true)
if (env.CHANGE_ID) {
// PR execution
codecovArgs += "-B ${env.CHANGE_TARGET} " +
Expand Down

0 comments on commit 4320d32

Please sign in to comment.