当 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/