I am using Jenkins Multibranch pipeline. I've configured the APIs (github-webhook and ghprbhook) on GitHub. Currently, If I click on "Scan Repository Now/Scan Repository Log" in Jenkins, the Jenkins will go through the GitHub and creates a new PR job in Jenkins if there are any PR on GitHub. So I need to trigger this Multibranch pipeline whenever there is a Pull Request raised on GitHub. I want this pipeline to trigger automatically when there is a PR on GitHub. What do I need to do to achieve this approach? Is it possible to trigger Multibranch pipeline automatically whenever a PR is raised on GitHub?
2 Answers
To achieve this, I have selected only "Push and Pull Request" under "Let me select individual events" section of GitHub Webhooks.
PS: The GitHub branches are automatically detected in Jenkins.

- 405
- 2
- 6
- 12
Du you use the GitHub pull request builder plugin?
This Jenkins plugin builds pull requests from GitHub and will report the results directly to the pull request via the GitHub Commit Status API
When a new pull request is opened in the project and the author of the pull request isn't whitelisted, builder will ask Can one of the admins verify this patch?. One of the admins can comment ok to test to accept this pull request for testing, test this please for one time test run and add to whitelist to add the author to the whitelist.
If an author of a pull request is whitelisted, adding a new pull request or new commit to an existing pull request will start a new build.
A new build can also be started with a comment: retest this please.
-
Thanks for your reply. GitHub Pull request Builder plugin is not supported in Pipeline file. – sunbogaa Nov 29 '17 at 06:52
-
I achieved this by selecting a webhook to trigger for all events ('Send me everything') – sunbogaa Nov 29 '17 at 06:59