Skip to content

Commit

Permalink
[CI] Ping assignees on Github PR comments (#91871) (#91901)
Browse files Browse the repository at this point in the history
Co-authored-by: Brian Seeders <[email protected]>
  • Loading branch information
kibanamachine and brianseeders authored Feb 18, 2021
1 parent 3efc70e commit 73e8b19
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions vars/githubPr.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,13 @@ def getNextCommentMessage(previousCommentInfo = [:], isFinal = false) {

messages << "To update your PR or re-run it, just comment with:\n`@elasticmachine merge upstream`"

catchErrors {
def assignees = getAssignees()
if (assignees) {
messages << "cc " + assignees.collect { "@${it}"}.join(" ")
}
}

info.builds << [
status: status,
url: env.BUILD_URL,
Expand Down Expand Up @@ -329,3 +336,19 @@ def shouldCheckCiMetricSuccess() {

return true
}

def getPR() {
withGithubCredentials {
def path = "repos/elastic/kibana/pulls/${env.ghprbPullId}"
return githubApi.get(path)
}
}

def getAssignees() {
def pr = getPR()
if (!pr) {
return []
}

return pr.assignees.collect { it.login }
}

0 comments on commit 73e8b19

Please sign in to comment.