Github 如何让Jenkins为管道作业自动添加webhook?
我已经为Jenkins添加了能够添加webhook的凭据。为此,我做了以下工作:Github 如何让Jenkins为管道作业自动添加webhook?,github,jenkins,jenkins-pipeline,webhooks,Github,Jenkins,Jenkins Pipeline,Webhooks,我已经为Jenkins添加了能够添加webhook的凭据。为此,我做了以下工作: 使用repo和admin:repo\u hook作用域在GitHub上生成个人访问令牌 添加了带有相应令牌的密文凭据 在Manage Jenkins>Configure System中添加了具有上一步凭据的GitHub服务器 但当我创建管道作业时,我在系统日志中看到: GitHub webhooks activated for job p1 with [] (events: [PUSH]) 通过自由泳项目,我得到
repo
和admin:repo\u hook
作用域在GitHub上生成个人访问令牌密文
凭据Manage Jenkins>Configure System
中添加了具有上一步凭据的GitHub服务器GitHub webhooks activated for job p1 with [] (events: [PUSH])
通过自由泳项目,我得到:
GitHub webhooks activated for job fsp1 with [GitHubRepositoryName[host=github.com,username=user,repository=repo]] (events: [PUSH])
PING webhook received from repo <https://github.com/user/repo>!
GitHubRepositoryName[host=GitHub.com,username=user,repository=repo]]为作业fsp1激活的GitHub webhook(事件:[推送])
PING webhook从回购收到!
对于自由泳项目,我做了以下工作:
我不知道为什么,但在从blueocean运行作业后,它会变得很好。要让它添加webhook(在创建管道后):
- 手动运行管道一次
- 重新注册Webhook(管理Jenkins>配置系统>GitHub插件>高级(带铅笔标记)>为所有作业重新注册hook)
这是一个众所周知的问题。您可以在这里查看:链接到您的。我猜行为源自类中的方法
parseAssociatedNames(项目、集合结果)
。项的类型有一些条件,很可能会导致这样的问题。你是个天才。不过,詹金斯。。。有点。。。让我伤心?看起来GitHub集成已经中断。我在尝试创建管道时遇到了4个问题。。。