0

这是我们的工具集: jenkins:在 AWS 服务器上运行的开源 Jenkins - 2.107.2 Github:2.13.3 版本

要求:我们需要创建一个 GitHub 钩子,如果有人合并分支(创建拉取请求并合并它),那么它应该触发 Jenkins 作业。我们不使用多分支管道,我们只使用管道作业,即我们使用 jenkisnfile 来运行我们的工作。

所以,我在 github webhooks 中启用了“PullRequestEvent”。然后我在 Jenkins 作业中为该特定作业启用了 scm 轮询。但是,问题是该作业被触发以提交到 xyz 分支以及如果我们合并拉取请求。但是,预期的行为是,作业应该只为合并触发。

polling log :
This page captures the polling log that triggered this build.
Started on Jul 17, 2018 2:04:00 PM
Using strategy: Default
[poll] Last Built Revision: Revision xyzz (origin/development)
> /app/digital/tools/git/bin/git --version # timeout=10
using GIT_ASKPASS to set credentials Githubread id generated on 20th Jan   2017
> /app/digital/tools/git/bin/git ls-remote -h https://github.xyz.net /abc/Test-SourceCode-Jenkins # timeout=10
Found 3 remote heads on https://github.xyz.net/abc/Test-SourceCode-Jenkins
[poll] Latest remote head revision on refs/heads/development is: xyzz
Done. Took 1.8 sec
Changes found

詹金斯配置:

詹金斯配置

4

0 回答 0