GitHub拉取请求构建器无法工作

3
Jenkins错误日志
Sep 10, 2015 11:26:55 AM org.jenkinsci.plugins.ghprb.GhprbTrigger stop
INFO: Stopping the ghprb trigger for project abc
Sep 10, 2015 11:26:55 AM org.jenkinsci.plugins.ghprb.GhprbTrigger start
INFO: Starting the ghprb trigger for the abc job; newInstance is true
Sep 10, 2015 11:26:55 AM org.jenkinsci.plugins.ghprb.GhprbGitHubAuth getBuilder
WARNING: credentialsId not set for context abc, using anonymous connection
Sep 10, 2015 11:26:57 AM org.jenkinsci.plugins.ghprb.GhprbRepository initGhRepository
SEVERE: Could not retrieve GitHub repository named organization/abc (Do you have properly set 'GitHub project' field in job configuration$
java.io.FileNotFoundException: {"message":"Not Found","documentation_url":"https://developer.github.com/v3"}

在配置设置中的“构建触发器”部分,我已经勾选了“当代码推送到Github时构建”和“Github拉取请求构建器”。 我还勾选了“使用Github钩子进行构建触发”。 在“管理Jenkins” -> “配置系统” -> “Github Pull Request Builder”下, 我已经在“凭据”字段中设置了自动生成的凭据。

enter image description here

我已在GitHub上设置了webhooks,对于推送到仓库的任何更改都可以正常工作,但对于拉取请求则不起作用。
1个回答

2
我认为自动生成的凭据无法使用。
WARNING: credentialsId not set for context abc, using anonymous connection

您需要在GitHub上生成一个令牌 (https://github.com/settings/tokens)。默认范围应该提供必要的权限。然后,在全局Jenkins拉取请求构建器配置中,使用您的GitHub用户名和生成的令牌添加新凭据。


您需要在密码字段中输入令牌。 - daspilker
密码字段在哪里?SCM 有什么作用吗?我应该在 SCM 同步配置下选择 git 吗? - Ajeet Khan
1
前往“管理Jenkins”->“配置系统”->“GitHub拉取请求构建器”部分。单击“凭据”字段旁边的“添加”按钮。在弹出窗口中,使用以下设置:类型->“用户名和密码”,范围->“全局(...)”,用户名->GitHub用户名,密码->GitHub OAuth令牌。 - daspilker
让我们在聊天中继续这个讨论 - Ajeet Khan
1
刚刚意识到“共享密钥”是自动生成的,不需要担心填写。 - eazy_g
显示剩余4条评论

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接