githubPRComment on failure
I would like to publish a comment on a PR builder with a job DSL config similar to this:
publishers {
githubPRComment {
comment {content('PR builder ${BUILD_NUMBER} ${BUILD_STATUS}')}
statusVerifier {buildStatus("FAILURE")}
errorHandler {buildStatus("UNSTABLE")}
}
}
My problem is that statusVerifier check for "better than or equal", which means this will fire every time the build is ran, but I only want to send a comment on failure. Is it possible to do this?
Build statuses has numerics https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/Result.java#L57-L80 try change criteria
Yes, that's my problem as the check is <=, which means if I write success it will run only on success, but if I write anything bigger, all of them will match (including success). I would either need exact matching (run only with a given status), or at least the opposite. (>= Check, so a success would mean all statuses, failure would mean anything above failure)
So how could I do this? Could you please make a verifier which makes it possible to do a comment if the build is failing?
maybe additional status verified need to be developed...
Could you do that, please?