jenkins - 创建拉取请求到分支时,Github 不触发作业

标签 jenkins github continuous-integration continuous-deployment

当 PR 创建到我在 github 中的暂存分支时,我需要运行 jenkins 作业。 jenkins 将运行一些测试用例并将结果返回到 github,然后我们才能将 PR 合并到 staging 分支。

我在 jenkins 中使用 GitHub pull request builder 插件。但是我在 jenkins 的工作在创建 PR 时并没有被触发。来自 github 的 webhook 是显示 200 状态,它正在为 github push 构建 jenkins 作业。

我遵循 https://medium.com/@mreigen/integrate-jenkins-builds-into-github-pull-requests-33bc053d6210 步骤。

任何人都可以帮我解决这个问题!

最佳答案

首先检查 Jenkins 日志。

例如,jenkinsci/ghprb-plugin issue 286 提到:

It looks like GitHub is sending the wrong kind of events.

  • The plugin only accepts pull_request and issue_comment events.
  • GitHub is sending a push event, so I am not sure but you might have configured the webhook using a different plugin?

Check your master config and make sure you are only telling the job triggers to use webhooks. Also, make sure you have checked the box in each job you want that says to build using webhooks.



Issue 603 涉及“使用 github hooks 进行构建触发”选项,但提到了一个 Hook URL 问题。

关于jenkins - 创建拉取请求到分支时,Github 不触发作业,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60825316/

相关文章:

docker - Jenkins 大师 - docker 奴隶 : Build shows error

jenkins - 如何从单个 Jenkins Pipeline 并行 block 中获取 stdout 和 stderr?

Git 使用从 GitHub 客户端同步来分离 HEAD

docker - Selenium Java自动化测试:在Gitlab CI中启动docker-compose并运行gradle test发生异常

groovy - 来自 email-ext jelly/groovy 脚本的实例变量来自哪里?

Jenkins 和 Kubernetes 与 Helm 的集成

github - 有没有办法知道谁下载了我的 Github 存储库

github - 如何使用脚本在 GitHub 上发布构建工件 Assets ?

continuous-integration - Github Action -是否有办法继续出错但仍能获得正确的反馈?

c++ - 我如何从终端的谷歌测试套件中获取 C++ 代码超量?