Skip to content

Instantly share code, notes, and snippets.

@adelevie
Forked from bjhess/pull_request_webhook.md
Created September 2, 2013 06:09
Show Gist options
  • Save adelevie/6409673 to your computer and use it in GitHub Desktop.
Save adelevie/6409673 to your computer and use it in GitHub Desktop.

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": "http://example.com/url/path"
  }
}
  • GET to https://api.github.com/repos/:username/:repo/hooks 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 http://requestb.in/ to test the hook.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment