Post-Receive Hooks
For help testing webhooks, see this guide
If you supply a post-receive URL, GitHub will POST to that URL when someone uses git push on that repository.

What we’ll send is JSON containing information about the push and the commits involved.
Here’s the template we use in Ruby to generate the JSON:
This is sent as a POST with a single parameter: ‘payload’
So, for example, you’d do something like this in a Sinatra server:
A template Rack server for the task: raggi/github_post_receive_server
Send something to Campfire, IRC, Twitter, your CI server, whatever. It’s your data.
The commits array is ordered with the most recent commit as the first element. The last element, therefor, is the oldest commit.
Here’s an example of a POST’d ‘payload’ JSON object:
For more information on this technique, see the Web Hooks Wiki.
