gpt4 book ai didi

github - Jenkins Github 插件未设置状态

转载 作者:行者123 更新时间:2023-12-02 07:00:09 27 4
gpt4 key购买 nike

我正在尝试从 Jenkins 作业设置 github 状态。 Jenkins 返回一个

[Set GitHub commit status (universal)] SUCCESS on repos [] (sha:9892fbd) with context:ci/jenkins/tests

...但是当我稍后使用 REST API 查询它时,状态未设置。

这是常规代码:

def getCommitHash() {
sh(script: """
git rev-parse HEAD
""", returnStdout: true).trim()
}


def setCountTestLocation(String location) {
url = "https://<internal github>/<org>/<repo>"
commitHash = getCommitHash()
print(url)
print(commitHash)
step([
$class: "GitHubCommitStatusSetter",
reposSource: [$class: "ManuallyEnteredRepositorySource", url: url],
contextSource: [$class: "ManuallyEnteredCommitContextSource", context: "ci/jenkins/tests"],
statusBackrefSource: [$class: "ManuallyEnteredBackrefSource", backref: location],
errorHandlers: [[$class: "ChangingBuildStatusErrorHandler", result: "UNSTABLE"]],
commitShaSource: [$class: "ManuallyEnteredShaSource", sha: commitHash],
statusResultSource: [ $class: "ConditionalStatusResultSource", results: [[$class: "AnyBuildResult", message: "Tests here!", state: "SUCCESS", location: location]] ]
]);
}

最佳答案

您的存储库尚未更新,因为存储库似乎未正确设置。
插件在正确完成运行时仍然报告成功,但存储库列表为空,如您的消息 SUCCESS on repos [] 所示。

关于github - Jenkins Github 插件未设置状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48189451/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com