Skip to content

Commit

Permalink
Don't post after later builds
Browse files Browse the repository at this point in the history
  • Loading branch information
brianseeders committed Jul 20, 2020
1 parent 77c6d80 commit 7c40a4c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion vars/githubPr.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,18 @@ def sendComment(isFinal = false) {

def status = buildUtils.getBuildStatus()
if (status == "ABORTED") {
return;
return
}

def lastComment = getLatestBuildComment()
def info = getLatestBuildInfo(lastComment) ?: [:]
info.builds = (info.builds ?: []).takeRight(5) // Rotate out old builds

// If two builds are running at the same time, the first one should not post a comment after the second one
if (info.number && info.number.toInteger() > env.BUILD_NUMBER.toInteger()) {
return
}

def shouldUpdateComment = !!info.builds.find { it.number == env.BUILD_NUMBER }

def message = getNextCommentMessage(info, isFinal)
Expand Down

0 comments on commit 7c40a4c

Please sign in to comment.