Skip to content

Instantly share code, notes, and snippets.

@alces
Created September 26, 2018 06:35
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save alces/fee73ad3a91bd44c75a57a3d5676307d to your computer and use it in GitHub Desktop.
Save alces/fee73ad3a91bd44c75a57a3d5676307d to your computer and use it in GitHub Desktop.
Using Jenkins pipelines as Github pull request cheks
  1. in Jenkins set up a multibranch pipeline with Branch source of type Github (under it, set up endpoint, credentials, repo name, etc.);
  2. in Github go to the repository Settings and add the user chosen on the previous step to the repository's colaborators;
  3. 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;
  4. create a pull request - after that Jenkins should automatically start a build;
  5. go to Branches menu under Settings and add the target branch to Protected branches;
  6. choose Require status checks to pass before merging and continuous-integration/jenkins/pr-merge under it
  7. commit a change into the pull request and see the Jenkins build result on the page.
@GitSiva1991
Copy link

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?

@alces
Copy link
Author

alces commented Jan 6, 2023

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