Jenkins和Github使用分叉的pr提交



我在设置Github和Jenkins CI.时遇到问题

当分叉的PR提交更改时,github不会通知jenkins,即使我已经接受了来自分叉回购的PR。只有当我将分叉回购的pr合并到master时,github才会触发Jenkins。

所以凭据和能力是存在的,但我在github中找不到强制所有对原始repo的提交(包括分叉的pr)触发CI的选项,有人有什么建议吗?

解决方案是使用Github Pull Request Builder插件

上面的链接中有一些对我有用的指令。除了默认指令外,我还必须这样做:

"This build is parameterized" and add string parameter named "sha1". When starting build give the "sha1" parameter commit id you want to build or refname (eg: "origin/pr/9/head").

并且我没有使用github hooks

GitHub中的后接收挂钩将向任何侦听服务发布任何收到的提交
它并不局限于某个特定的分支。

但是,可以将Jenkins设置为监视特定的分支
除非,如"How can I make Jenkins CI with git trigger on pushs to master?"中所述,您将Jenkins CI配置为从GitHub轮询(在这种情况下,它将侦听所述GitHub钩子,而不是在特定分支上执行git pull。
OP Coombesy的回答中提到的GitHub拉请求构建器插件是Jenkins轮询GitHub的另一种方式。

最新更新