Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/jenkins/5.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
Github 如何让Jenkins为管道作业自动添加webhook?_Github_Jenkins_Jenkins Pipeline_Webhooks - Fatal编程技术网

Github 如何让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]) 通过自由泳项目,我得到

我已经为Jenkins添加了能够添加webhook的凭据。为此,我做了以下工作:

  • 使用
    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从回购收到!
    
    对于自由泳项目,我做了以下工作:

  • 在“源代码管理”选项卡上,选择Git、指定的存储库URL和凭据(用户名和密码)
  • 已检查GITScm轮询的GitHub钩子触发器
  • 对于管道作业:

  • 已选中GitHub项目和指定的存储库URL
  • 已检查GITScm轮询的GitHub钩子触发器
  • 我遗漏了什么?

    我也有类似的问题。
    我不知道为什么,但在从blueocean运行作业后,它会变得很好。

    要让它添加webhook(在创建管道后):

    • 手动运行管道一次
    • 重新注册Webhook(管理Jenkins>配置系统>GitHub插件>高级(带铅笔标记)>为所有作业重新注册hook)

    这是一个众所周知的问题。您可以在这里查看:

    链接到您的。我猜行为源自类中的方法
    parseAssociatedNames(项目、集合结果)
    项的类型有一些条件,很可能会导致这样的问题。你是个天才。不过,詹金斯。。。有点。。。让我伤心?看起来GitHub集成已经中断。我在尝试创建管道时遇到了4个问题。。。