in dsl/scripts/pr_check.groovy [171:185]
void postComment(String commentText, String githubTokenCredsId = "kie-ci1-token") {
if (!CHANGE_ID) {
error "Pull Request Id variable (CHANGE_ID) is not set. Are you sure you are running with Github Branch Source plugin ?"
}
String filename = "${util.generateHash(10)}.build.summary"
def jsonComment = [
body : commentText
]
writeJSON(json: jsonComment, file: filename)
sh "cat ${filename}"
withCredentials([string(credentialsId: githubTokenCredsId, variable: 'GITHUB_TOKEN')]) {
sh "curl -s -H \"Authorization: token ${GITHUB_TOKEN}\" -X POST -d '@${filename}' \"https://api.github.com/repos/${BUILDCHAIN_PROJECT}/issues/${CHANGE_ID}/comments\""
}
sh "rm ${filename}"
}