Jenkins与github如何覆盖git状态消息

时间:2018-06-10 23:28:33

标签: jenkins github jenkins-pipeline

我正在尝试使用以下代码覆盖提交状态消息,但它不起作用消息总是同样称为“此提交看起来很好”,无论我通过任何洞察力都会很棒

 void setBuildStatus(String message, String state) {
  step([
      $class: "GitHubCommitStatusSetter",
      reposSource: [$class: "ManuallyEnteredRepositorySource", url: "https://github.com/xxxx/Testing_App"],
      contextSource: [$class: "ManuallyEnteredCommitContextSource", context: "ci/jenkins/build-status/sumeet"],
      errorHandlers: [[$class: "ChangingBuildStatusErrorHandler", result: "UNSTABLE"]],
      statusResultSource: [ $class: "ConditionalStatusResultSource", results: [[$class: "AnyBuildResult", message: message, state: state]] ]
  ]);
}

0 个答案:

没有答案