This is our tool set: jenkins: Open source Jenkins running on AWS server - 2.107.2 Github: 2.13.3 version
Requirement: We need to create a GitHub hook in such a way that, if anyone merges the branch (create pull request and merge it), then it should trigger the Jenkins job.We do not use multibranch pipeline, we use just pipeline jobs i.e we use jenkisnfile to run our jobs.
so, i have enabled the "PullRequestEvent" in github webhooks. Then i have enabled scm polling in Jenkins job for that particular job.But, the issue is the job is getting triggered for a commit to the xyz branch and also if we merge the pull request. But, the expected behavior is, the job should be triggered only for the merge.
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
jenkins configuration: