Interview Prep/Jenkins/Multibranch, organization folders & webhooks

How does a GitHub webhook reach Jenkins and what URL do you configure?

BeginnerConceptMultibranch, organization folders & webhooks
Answer

With the GitHub plugin and GitHub Branch Source, configure the webhook in the repo or org as:

  • Payload URL: https://jenkins.example.com/github-webhook/ (the trailing slash matters)
  • Content type: application/json
  • Events: push, pull requests (and optionally "Send me everything")
  • Secret: shared secret configured in Jenkins under the GitHub server's Shared secrets for HMAC validation

Jenkins receives the event, matches it to multibranch jobs for that repo, re-indexes the affected head and triggers the build. GitHub's Recent Deliveries shows the response code.

All Jenkins questions Roadmap: Jenkins

More on Multibranch, organization folders & webhooks