Jenkins-Build when a change is pushed to GitHub option is not working

I had the same problem and solved it. The problem was that the URL had to end with a /. Meaning:

http://<jenkinsurl>:8080/github-webhook/

http://<jenkinsurl>:8080/github-webhook

(Notice the missing / at the end.)


I suspect you missed the webhook url.

Besides checking the Build when a change is pushed to GitHub option, you should also add the webhook url into your Github repository to get the Auto trigger mechanism to work and here is how:

Go to your Github repository:

Settings--> Webhooks&Services-->Service--> Add Services--> Choose "Jenkins (GitHub plugin)"

Then fill in the Jenkins hook url with your jenkins url like this: http://your_jenkins_url/github-webhook/ enter image description here


And, VERY IMPORTANT, since you are installing your jenkins server in your localhost, please be aware that you shouldn't fill in above Jenkins hook url like http://localhost:8080/github-webhook/ because Github is not able to recognize localhost or 127.0.0.1 or 192.168.*.*.

Either you should use an externally accessible DNS name or an IP address, which can be recognized by Github.