Instantly share code, notes, and snippets.

What would you like to do?
The way I had to add a github repo webhook for pull requests

This is more complex than necessary.

GitHub webhooks for a URL by default only fire on repo pushes. There appears to be no way in the web UI to set up webhooks for other events. And so we go to the API. I prefer to do this type of thing with Hurl.

  "name": "web",
  "active": true,
  "events": ["pull_request"],
  "config": {
    "url": ""
  • GET to to check if the webhook you created has the proper event applied.
  • You will see the URL in the admin section of your repo, and you can change it. There will be no mention of what events the URL fires on, but it should stick to pull_request.
  • You can use to test the hook.

This comment has been minimized.

FMRobot commented Mar 2, 2013

Sound cool!


This comment has been minimized.

commandtab commented May 30, 2013

Thanks for posting this Google food!


This comment has been minimized.

statico commented Nov 9, 2013



This comment has been minimized.

steve-jansen commented Mar 10, 2014

FYI - the GitHub dev team announced better Web UI support for web hooks in their Feburary 11th, 2014 post Webhooks level up. Nice work nonetheless making stuff work!


This comment has been minimized.

khurshid-alam commented Jul 28, 2014

Is it possible to set webhook for new pull requests for those repos I do NOT own?


This comment has been minimized.

harisheidiko commented Jun 1, 2016

Nice code,but It's giving 404 error when i am trying to hit through postman


This comment has been minimized.

donald-pinckney commented Jun 26, 2016

@harisheidiko You need to use HTTP authentication for this, otherwise it will 404.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment