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.
More on Multibranch, organization folders & webhooks
How does a multibranch pipeline work?BeginnerWhat is branch indexing and what triggers it?BeginnerWhat are the discovery traits in the GitHub branch source?IntermediateWhat does the fork PR trust setting protect against?AdvancedWhat environment variables are set for PR builds?BeginnerWhat is an organization folder?Intermediate