简体   繁体   中英

Jenkins Multibranch pipeline not triggering PR builds from Github

I'm using Jenkins 2.60.2. I've set up a Multibranch pipeline build. I also set up the Github side by configuring the Jenkins service via Integrations & services via the Github plugin (not the webhook option in Github).

I'm able to see the branches I want and some PRs that are sitting out there. So things seem to be working.

My issue is that when I add a commit to one of the pull requests, I see the event come through in the Repository Events, but the pull request never rebuilds in Jenkins. If I click Scan Repository Now, it detects the change and starts a new build of the PR. I would expect it to detect the change on the commit and rebuild the PR.

The other odd thing is that I have it set up to not build branches with PRs, but when I make a new PR from a new branch, it builds it as a branch (on the branches tab) but not on the PR tab. Again, running a repository scan, removes the build from the branches tab, and adds it to the PR tab. I would expect that a PR from a new branch would just create a build on the PR tab, not the branches.

I'm at a bit of a loss here. I can see when I push a change to Github, an event is getting sent to Jenkins, it just isn't behaving in the way I would expect.I'm using a Jenkinsfile in the repository if that makes any difference.

So for now, I was able to carry on.

On Github, in Settings -> Integrations & services, I removed the Jenkins service. I went into Settings -> Webhooks, and I created a new Webhook with the same URL I used in the service and I picked the events to send. I am sending push events and pull request events and now things are working as I expected.

After looking at the repository events, it looks like using the Jenkins Service (Github plugin) on the Github side is not sending over pull request events. I'm trying to track down where to post that issue, but I'm unsure.

Hopefully this helps someone else out.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM