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.
Triggering Jenkins Multibranch pipeline when there is a pull request created in GitHub
Asked Answered
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.
Thanks for your reply. I have selected 'Send everything' under webhook section and it worked for me. –
Malkamalkah
Can you mark the answer as correct if that helped you? –
Jana
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.
© 2022 - 2024 — McMap. All rights reserved.