Skip to content

Commit

Permalink
Don't fail the build if grabbing failed steps fails
Browse files Browse the repository at this point in the history
  • Loading branch information
brianseeders committed Mar 20, 2020
1 parent 14c21b0 commit 20cd78e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions vars/githubPr.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,15 @@ def getNextCommentMessage(previousCommentInfo = [:]) {
* [Interpreting CI Failures](https://www.elastic.co/guide/en/kibana/current/interpreting-ci-failures.html)
"""

def steps = getFailedSteps()
if (steps?.size() > 0) {
def list = steps.collect { "* [${it.displayName}](${it.logs})" }.join("\n")
messages << "### Failed CI Steps\n${list}"
try {
def steps = getFailedSteps()
if (steps?.size() > 0) {
def list = steps.collect { "* [${it.displayName}](${it.logs})" }.join("\n")
messages << "### Failed CI Steps\n${list}"
}
} catch (ex) {
buildUtils.printStacktrace(ex)
print "Error retrieving failed pipeline steps for PR comment, will skip this section"
}
}

Expand Down

0 comments on commit 20cd78e

Please sign in to comment.