sunbogaa
sunbogaa

Reputation: 460

Triggering Jenkins Multibranch pipeline when there is a pull request created in GitHub

I'm using Jenkins Multibranch pipeline. I've configured the APIs(github-webhook and ghprbhook) in GitHub. I want to trigger the Multibranch Pipeline whenever there is a Pull Request on GitHub (without using periodical option). For example, if i create pull request on GitHub, then the Jenkins Multibranch pipeline should start scanning and build the Jenkinsfile automatically. What do i need to do to achieve this? I would love to try if there are any suggestions.

Upvotes: 5

Views: 10984

Answers (2)

sunbogaa
sunbogaa

Reputation: 460

To achieve this, I have selected "Send me everything" under GitHub Webhooks section. Then I was able to trigger builds automatically whenever a PR is raised on GitHub.

As @RSharma mentioned, I have selected only "Push and Pull Request" under "Let me select individual events" section.

PS: The GitHub branches are automatically detected in Jenkins.

Upvotes: 1

RSharma
RSharma

Reputation: 130

Under the webhook section, you can choose Let me select individual events option. Under that you can have push selected by default and also can select Pull Request which helps you to do wnat you are looking for Pull request opened, closed, reopened, edited, assigned, unassigned, review requested, review request removed, labeled, unlabeled, or synchronized.

Upvotes: 6

Related Questions