- in Jenkins set up a multibranch pipeline with Branch source of type
Github
(under it, set up endpoint, credentials, repo name, etc.); - in Github go to the repository Settings and add the user chosen on the previous step to the repository's colaborators;
- go to the Hooks menu and add a webhook pointing to
<your-jenkins-host>/github-webhook/
and select pull request event under Let me select individual events option; - create a pull request - after that Jenkins should automatically start a build;
- go to Branches menu under Settings and add the target branch to Protected branches;
- choose Require status checks to pass before merging and
continuous-integration/jenkins/pr-merge
under it - commit a change into the pull request and see the Jenkins build result on the page.
Created
September 26, 2018 06:35
-
-
Save alces/fee73ad3a91bd44c75a57a3d5676307d to your computer and use it in GitHub Desktop.
Using Jenkins pipelines as Github pull request cheks
Hi, I don't know exact steps, but I've an impression that in order to appear on the list, the check should be executed at least once. A kind of a chicken-and-egg problem ;)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi alces,
I am unable to get the result for "continuous-integration/jenkins/pr-merge" in edit branch page.
Can you please provide the steps to get it?