Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jenkins设置github提交状态不工作_Git_Jenkins - Fatal编程技术网

Jenkins设置github提交状态不工作

Jenkins设置github提交状态不工作,git,jenkins,Git,Jenkins,我看到在日志中调用了该命令,但在GitHub中它没有显示状态 [Set GitHub commit status (universal)] PENDING on repos [] (sha:47ccf20) with context:api webhook url工作正常,正在通知Jenkins何时构建 我还安装了GitHub服务器,测试连接正在工作 关于我在设置中可能缺少的内容,有什么想法吗 我遵循了这个问题中的步骤,但仍然没有在github中显示任何内容:如果您遵循了共享链接中的步骤,那么

我看到在日志中调用了该命令,但在GitHub中它没有显示状态

[Set GitHub commit status (universal)] PENDING on repos [] (sha:47ccf20) with context:api
webhook url工作正常,正在通知Jenkins何时构建

我还安装了GitHub服务器,测试连接正在工作

关于我在设置中可能缺少的内容,有什么想法吗


我遵循了这个问题中的步骤,但仍然没有在github中显示任何内容:

如果您遵循了共享链接中的步骤,那么您可能错过了步骤9之后的关键步骤(设置github提交状态)在内容部分的状态结果选项中选择第二个选项,如下所示:

这将允许您为每个构建发送默认状态消息(错误、失败、成功、挂起)。选择第一个选项需要您手动定义要发回的状态(默认情况下为“无”,这可能解释了您没有收到任何内容的原因)

还要确保Github上的Webhook部分中的有效负载url已使用生成的令牌正确配置。我认为你做得很好


您可以选择让我选择单个事件,以更好地控制Jenkins可以发送的内容,但请确保选中了repo:status选项。希望对您有所帮助。

要进行调试,请使用下面的CLI命令检查您的访问令牌是否能够在GitHub中为任何虚拟测试PR设置状态

curl "https://api.github.com/repos/[organization name]/[repo name]/statuses/[commit id]?access_token=[GitHub access token]" -H "Content-Type: application/json"   -X POST -d "{\"state\": \"success\", \"description\": \"Build Successful \", \"target_url\": \"[jenkins job url]\", \"context\": \"[Job name]\" }"

PS:删除方括号

即使在遵循OP链接中的所有答案后,它也不适用于我


问题是我生成的个人访问令牌的范围。它需要对私有存储库进行
完全控制
访问,而不仅仅是
repo:status

“确保选中repo:status选项”