CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Sat, 06 Sep 2025 05:28:59 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20090322170536
location: https://web.archive.org/web/20090322170536/https://github.com/guides/post-receive-hooks.atom
server-timing: captures_list;dur=0.779503, exclusion.robots;dur=0.028794, exclusion.robots.policy;dur=0.017545, esindex;dur=0.010761, cdx.remote;dur=5.617063, LoadShardBlock;dur=138.942662, PetaboxLoader3.datanode;dur=66.815165, PetaboxLoader3.resolve;dur=38.115457
x-app-server: wwwb-app202
x-ts: 302
x-tr: 218
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
set-cookie: wb-p-SERVER=wwwb-app202; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Sat, 06 Sep 2025 05:28:59 GMT
content-type: application/atom+xml; charset=utf-8
content-length: 76241
x-archive-orig-server: nginx/0.6.31
x-archive-orig-date: Sun, 22 Mar 2009 17:05:36 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-x-runtime: 597ms
x-archive-orig-etag: "d599baf43e0d8451833a2ea233fe555c"
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-orig-content-length: 76241
cache-control: max-age=1800
x-archive-guessed-content-type: text/xml
x-archive-guessed-charset: utf-8
memento-datetime: Sun, 22 Mar 2009 17:05:36 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Thu, 13 Nov 2008 11:55:18 GMT", ; rel="prev memento"; datetime="Tue, 30 Dec 2008 02:50:38 GMT", ; rel="memento"; datetime="Sun, 22 Mar 2009 17:05:36 GMT", ; rel="last memento"; datetime="Sun, 22 Mar 2009 17:05:36 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_8_20090322101416_crawl100-c/52_8_20090322170437_crawl101.arc.gz
server-timing: captures_list;dur=0.593642, exclusion.robots;dur=0.027721, exclusion.robots.policy;dur=0.017152, esindex;dur=0.009926, cdx.remote;dur=9.072183, LoadShardBlock;dur=108.510492, PetaboxLoader3.datanode;dur=80.560006, PetaboxLoader3.resolve;dur=95.116383, load_resource;dur=116.379321
x-app-server: wwwb-app202
x-ts: 200
x-tr: 278
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
accept-ranges: bytes
tag:github.com,2008:/guides/post-receive-hooks
GitHub Guides - Post-Receive Hooks
2009-02-19T03:52:47-08:00
tag:github.com,2008:Guide/12
2008-02-15T16:33:09-08:00
2009-02-19T03:52:47-08:00
Post-Receive Hooks - version 17
Thu Feb 19 03:52:47 -0800 2009
<p><strong>Note:</strong> On July 30th, 2008 the post-receive’s <span class="caps">JSON</span> changed. See before and after examples further down the page.</p>
<p>If you supply a post-receive <span class="caps">URL</span>, GitHub will <span class="caps">POST</span> to that <span class="caps">URL</span> when someone uses <code>git push</code> on that repository.</p>
<p><img src="https://img.skitch.com/20080216-j3jkyuhaidw2wucsxbqd9angur.png"/></p>
<p>What we’ll send is <span class="caps">JSON</span> containing information about the push and the commits involved.</p>
<p>Here’s the template we use in Ruby to generate the <span class="caps">JSON</span>:</p>
<pre>
{
:before => before,
:after => after,
:ref => ref,
:commits => [{
:id => commit.id,
:message => commit.message,
:timestamp => commit.committed_date.xmlschema,
:url => commit_url,
:added => array_of_added_paths,
:removed => array_of_removed_paths,
:modified => array_of_modified_paths,
:author => {
:name => commit.author.name,
:email => commit.author.email
}
}],
:repository => {
:name => repository.name,
:url => repo_url,
:pledgie => repository.pledgie.id
:description => repository.description,
:homepage => repository.homepage,
:watchers => repository.watchers.size,
:forks => repository.forks.size,
:private => repository.private?,
:owner => {
:name => repository.owner.login,
:email => repository.owner.email
}
}
}
</pre>
<p>This is sent as a <span class="caps">POST</span> with a single parameter: ‘payload’</p>
<p>So, for example, you’d do something like this in a <a href="https://sinatra.rubyforge.org/">Sinatra</a> server:</p>
<pre>
post '/' do
push = JSON.parse(params[:payload])
"I got some JSON: #{push.inspect}"
end
</pre>
<p>A template Rack server for the task: <a href="https://github.com/raggi/github_post_receive_server/">raggi/github_post_receive_server</a></p>
<p>Send something to <a href="https://github.com/jnewland/github-campfire/">Campfire</a>, <a href="https://github.com/webs/irccat"><span class="caps">IRC</span></a>, <a href="https://github.com/jnunemaker/github-twitter/">Twitter</a>, your CI server, whatever. It’s your data.</p>
<p>Note that the <span class="caps">JSON</span> format is new as of <strong>July 30th 2008</strong>. Prior to this date the <code>commits</code> key was a normal hash-like JS object, not an array.</p>
<p>The <code>commits</code> array is ordered with the most recent commit as the first element. The last element, therefor, is the oldest commit.</p>
<p>Here’s an example of a <span class="caps">POST</span>’d ‘payload’ <span class="caps">JSON</span> object:</p>
<pre>
{
"before": "5aef35982fb2d34e9d9d4502f6ede1072793222d",
"repository": {
"url": "https://github.com/defunkt/github",
"name": "github",
"description": "You're lookin' at it.",
"watchers": 5,
"forks": 2,
"private": 1,
"owner": {
"email": "chris@ozmm.org",
"name": "defunkt"
}
},
"commits": [
{
"id": "41a212ee83ca127e3c8cf465891ab7216a705f59",
"url": "https://github.com/defunkt/github/commit/41a212ee83ca127e3c8cf465891ab7216a705f59",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "okay i give in",
"timestamp": "2008-02-15T14:57:17-08:00",
"added": ["filepath.rb"]
},
{
"id": "de8251ff97ee194a289832576287d6f8ad74e3d0",
"url": "https://github.com/defunkt/github/commit/de8251ff97ee194a289832576287d6f8ad74e3d0",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "update pricing a tad",
"timestamp": "2008-02-15T14:36:34-08:00"
}
],
"after": "de8251ff97ee194a289832576287d6f8ad74e3d0",
"ref": "refs/heads/master"
}
</pre>
<p>For more information on this technique, see the <a href="https://webhooks.pbwiki.com/">Web Hooks Wiki</a>.</p>
jicksta
tag:github.com,2008:Guide/12
2008-02-15T16:33:09-08:00
2009-02-19T03:52:11-08:00
Post-Receive Hooks - version 16
Thu Feb 19 03:52:11 -0800 2009
<p><strong>Note:</strong> On July 30th, 2008 the post-receive’s <span class="caps">JSON</span> changed. See before and after examples further down the page.</p>
<p>If you supply a post-receive <span class="caps">URL</span>, GitHub will <span class="caps">POST</span> to that <span class="caps">URL</span> when someone uses <code>git push</code> on that repository.</p>
<p><img src="https://img.skitch.com/20080216-j3jkyuhaidw2wucsxbqd9angur.png"/></p>
<p>What we’ll send is <span class="caps">JSON</span> containing information about the push and the commits involved.</p>
<p>Here’s the template we use in Ruby to generate the <span class="caps">JSON</span>:</p>
<pre>
{
:before => before,
:after => after,
:ref => ref,
:commits => [{
:id => commit.id,
:message => commit.message,
:timestamp => commit.committed_date.xmlschema,
:url => commit_url,
:added => array_of_added_paths,
:removed => array_of_removed_paths,
:modified => array_of_modified_paths,
:author => {
:name => commit.author.name,
:email => commit.author.email
}
}],
:repository => {
:name => repository.name,
:url => repo_url,
:pledgie => repository.pledgie.id
:description => repository.description,
:homepage => repository.homepage,
:watchers => repository.watchers.size,
:forks => repository.forks.size,
:private => repository.private?,
:owner => {
:name => repository.owner.login,
:email => repository.owner.email
}
}
}
</pre>
<p>This is sent as a <span class="caps">POST</span> with a single parameter: ‘payload’</p>
<p>So, for example, you’d do something like this in a <a href="https://sinatra.rubyforge.org/">Sinatra</a> server:</p>
<pre>
post '/' do
push = JSON.parse(params[:payload])
"I got some JSON: #{push.inspect}"
end
</pre>
<p>A template Rack server for the task: <a href="https://github.com/raggi/github_post_receive_server/">raggi/github_post_receive_server</a></p>
<p>Send something to <a href="https://github.com/jnewland/github-campfire/">Campfire</a>, <a href="https://github.com/webs/irccat"><span class="caps">IRC</span></a>, <a href="https://github.com/jnunemaker/github-twitter/">Twitter</a>, your CI server, whatever. It’s your data.</p>
<p>Note that the <span class="caps">JSON</span> format is new as of <strong>July 30th</strong>. Prior to this date the <code>commits</code> key was a normal hash-like JS object, not an array.</p>
<p>The <code>commits</code> array is ordered with the most recent commit as the first element. The last element, therefor, is the oldest commit.</p>
<p>Here’s an example of a <span class="caps">POST</span>’d ‘payload’ <span class="caps">JSON</span> object:</p>
<pre>
{
"before": "5aef35982fb2d34e9d9d4502f6ede1072793222d",
"repository": {
"url": "https://github.com/defunkt/github",
"name": "github",
"description": "You're lookin' at it.",
"watchers": 5,
"forks": 2,
"private": 1,
"owner": {
"email": "chris@ozmm.org",
"name": "defunkt"
}
},
"commits": [
{
"id": "41a212ee83ca127e3c8cf465891ab7216a705f59",
"url": "https://github.com/defunkt/github/commit/41a212ee83ca127e3c8cf465891ab7216a705f59",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "okay i give in",
"timestamp": "2008-02-15T14:57:17-08:00",
"added": ["filepath.rb"]
},
{
"id": "de8251ff97ee194a289832576287d6f8ad74e3d0",
"url": "https://github.com/defunkt/github/commit/de8251ff97ee194a289832576287d6f8ad74e3d0",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "update pricing a tad",
"timestamp": "2008-02-15T14:36:34-08:00"
}
],
"after": "de8251ff97ee194a289832576287d6f8ad74e3d0",
"ref": "refs/heads/master"
}
</pre>
<p>For more information on this technique, see the <a href="https://webhooks.pbwiki.com/">Web Hooks Wiki</a>.</p>
jicksta
tag:github.com,2008:Guide/12
2008-02-15T16:33:09-08:00
2008-07-31T10:56:54-07:00
Post-Receive Hooks - version 15
Thu Jul 31 10:56:54 -0700 2008
<p><strong>Note:</strong> On July 30th, the post-receive’s <span class="caps">JSON</span> will change. See before and after examples further down the page.</p>
<p>If you supply a post-receive <span class="caps">URL</span>, GitHub will <span class="caps">POST</span> to that <span class="caps">URL</span> when someone uses <code>git push</code> on that repository.</p>
<p><img src="https://img.skitch.com/20080216-j3jkyuhaidw2wucsxbqd9angur.png"/></p>
<p>What we’ll send is <span class="caps">JSON</span> containing information about the push and the commits involved.</p>
<p>Here’s the template we use in Ruby to generate the <span class="caps">JSON</span>:</p>
<pre>
{
:before => before,
:after => after,
:ref => ref,
:commits => [{
:id => commit.id,
:message => commit.message,
:timestamp => commit.committed_date.xmlschema,
:url => commit_url,
:added => array_of_added_paths,
:removed => array_of_removed_paths,
:modified => array_of_modified_paths,
:author => {
:name => commit.author.name,
:email => commit.author.email
}
}],
:repository => {
:name => repository.name,
:url => repo_url,
:pledgie => repository.pledgie.id
:description => repository.description,
:homepage => repository.homepage,
:watchers => repository.watchers.size,
:forks => repository.forks.size,
:private => repository.private?,
:owner => {
:name => repository.owner.login,
:email => repository.owner.email
}
}
}
</pre>
<p>This is sent as a <span class="caps">POST</span> with a single parameter: ‘payload’</p>
<p>So, for example, you’d do something like this in a <a href="https://sinatra.rubyforge.org/">Sinatra</a> server:</p>
<pre>
post '/' do
push = JSON.parse(params[:payload])
"I got some JSON: #{push.inspect}"
end
</pre>
<p>A template Rack server for the task: <a href="https://github.com/raggi/github_post_receive_server/">raggi/github_post_receive_server</a></p>
<p>Send something to <a href="https://github.com/jnewland/github-campfire/">Campfire</a>, <a href="https://github.com/webs/irccat"><span class="caps">IRC</span></a>, <a href="https://github.com/jnunemaker/github-twitter/">Twitter</a>, your CI server, whatever. It’s your data.</p>
<p>Note that the <span class="caps">JSON</span> format is new as of <strong>July 30th</strong>. Prior to this date the <code>commits</code> key was a normal hash-like JS object, not an array.</p>
<p>The <code>commits</code> array is ordered with the most recent commit as the first element. The last element, therefor, is the oldest commit.</p>
<p>Here’s an example of a <span class="caps">POST</span>’d ‘payload’ <span class="caps">JSON</span> object:</p>
<pre>
{
"before": "5aef35982fb2d34e9d9d4502f6ede1072793222d",
"repository": {
"url": "https://github.com/defunkt/github",
"name": "github",
"description": "You're lookin' at it.",
"watchers": 5,
"forks": 2,
"private": 1,
"owner": {
"email": "chris@ozmm.org",
"name": "defunkt"
}
},
"commits": [
{
"id": "41a212ee83ca127e3c8cf465891ab7216a705f59",
"url": "https://github.com/defunkt/github/commit/41a212ee83ca127e3c8cf465891ab7216a705f59",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "okay i give in",
"timestamp": "2008-02-15T14:57:17-08:00",
"added": ["filepath.rb"]
},
{
"id": "de8251ff97ee194a289832576287d6f8ad74e3d0",
"url": "https://github.com/defunkt/github/commit/de8251ff97ee194a289832576287d6f8ad74e3d0",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "update pricing a tad",
"timestamp": "2008-02-15T14:36:34-08:00"
}
],
"after": "de8251ff97ee194a289832576287d6f8ad74e3d0",
"ref": "refs/heads/master"
}
</pre>
<p>For more information on this technique, see the <a href="https://webhooks.pbwiki.com/">Web Hooks Wiki</a>.</p>
topfunky
tag:github.com,2008:Guide/12
2008-02-15T16:33:09-08:00
2008-07-30T16:54:57-07:00
Post-Receive Hooks - version 14
Wed Jul 30 16:54:57 -0700 2008
<p><strong>Note:</strong> On July 30th, the post-receive’s <span class="caps">JSON</span> will change. See before and after examples further down the page.</p>
<p>If you supply a post-receive <span class="caps">URL</span>, GitHub will <span class="caps">POST</span> to that <span class="caps">URL</span> when someone uses <code>git push</code> on that repository.</p>
<p><img src="https://img.skitch.com/20080216-j3jkyuhaidw2wucsxbqd9angur.png"/></p>
<p>What we’ll send is <span class="caps">JSON</span> containing information about the push and the commits involved.</p>
<p>Here’s the template we use in Ruby to generate the <span class="caps">JSON</span>:</p>
<pre>
{
:before => before,
:after => after,
:ref => ref,
:commits => [{
:id => commit.id,
:message => commit.message,
:timestamp => commit.committed_date.xmlschema,
:url => commit_url,
:added => array_of_added_paths,
:removed => array_of_removed_paths,
:modified => array_of_modified_paths,
:author => {
:name => commit.author.name,
:email => commit.author.email
}
}],
:repository => {
:name => repository.name,
:url => repo_url,
:pledgie => repository.pledgie.id
:description => repository.description,
:homepage => repository.homepage,
:watchers => repository.watchers.size,
:forks => repository.forks.size,
:private => repository.private?,
:owner => {
:name => repository.owner.login,
:email => repository.owner.email
}
}
}
</pre>
<p>This is sent as a <span class="caps">POST</span> with a single parameter: ‘payload’</p>
<p>So, for example, you’d do something like this in a <a href="https://sinatra.rubyforge.org/">Sinatra</a> server:</p>
<pre>
post '/' do
push = JSON.parse(params[:payload])
"I got some JSON: #{push.inspect}"
end
</pre>
<p>A template Rack server for the task: <a href="https://github.com/raggi/github_post_receive_server/">raggi/github_post_receive_server</a></p>
<p>Send something to <a href="https://github.com/jnewland/github-campfire/">Campfire</a>, <a href="https://github.com/webs/irccat"><span class="caps">IRC</span></a>, <a href="https://github.com/jnunemaker/github-twitter/">Twitter</a>, your CI server, whatever. It’s your data.</p>
<p>Note that the <span class="caps">JSON</span> format is new as of <strong>July 30th</strong>. Prior to this date the <code>commits</code> key was a normal hash-like JS object, not an array.</p>
<p>The <code>commits</code> array is ordered with the most recent commit as the first element. The last element, therefor, is the oldest commit.</p>
<p>Here’s an example of a <span class="caps">POST</span>’d ‘payload’ <span class="caps">JSON</span> object:</p>
<pre>
{
"before": "5aef35982fb2d34e9d9d4502f6ede1072793222d",
"repository": {
"url": "https://github.com/defunkt/github",
"name": "github",
"description": "You're lookin' at it."
"watchers": 5,
"forks": 2,
"private": 1,
"owner": {
"email": "chris@ozmm.org",
"name": "defunkt"
}
},
"commits": [
{
"id": "41a212ee83ca127e3c8cf465891ab7216a705f59",
"url": "https://github.com/defunkt/github/commit/41a212ee83ca127e3c8cf465891ab7216a705f59",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "okay i give in",
"timestamp": "2008-02-15T14:57:17-08:00",
"added": ["filepath.rb"]
},
{
"id": "de8251ff97ee194a289832576287d6f8ad74e3d0",
"url": "https://github.com/defunkt/github/commit/de8251ff97ee194a289832576287d6f8ad74e3d0",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "update pricing a tad",
"timestamp": "2008-02-15T14:36:34-08:00"
}
],
"after": "de8251ff97ee194a289832576287d6f8ad74e3d0",
"ref": "refs/heads/master"
}
</pre>
<p>For more information on this technique, see the <a href="https://webhooks.pbwiki.com/">Web Hooks Wiki</a>.</p>
defunkt
tag:github.com,2008:Guide/12
2008-02-15T16:33:09-08:00
2008-07-24T10:37:51-07:00
Post-Receive Hooks - version 13
Thu Jul 24 10:37:51 -0700 2008
<p><strong>Note:</strong> On July 30th, the post-receive’s <span class="caps">JSON</span> will change. See before and after examples further down the page.</p>
<p>If you supply a post-receive <span class="caps">URL</span>, GitHub will <span class="caps">POST</span> to that <span class="caps">URL</span> when someone uses <code>git push</code> on that repository.</p>
<p><img src="https://img.skitch.com/20080216-j3jkyuhaidw2wucsxbqd9angur.png"/></p>
<p>What we’ll send is <span class="caps">JSON</span> containing information about the push and the commits involved.</p>
<p>Here’s the template we use in Ruby to generate the <span class="caps">JSON</span>:</p>
<pre>
{
:before => before,
:after => after,
:ref => ref,
:commits => [{
:id => commit.id,
:message => commit.message,
:timestamp => commit.committed_date.xmlschema,
:url => commit_url,
:added => array_of_added_paths,
:removed => array_of_removed_paths,
:modified => array_of_modified_paths,
:author => {
:name => commit.author.name,
:email => commit.author.email
}
}],
:repository => {
:name => repository.name,
:url => repo_url,
:owner => {
:name => repository.owner.login,
:email => repository.owner.email
}
}
}
</pre>
<p>This is sent as a <span class="caps">POST</span> with a single parameter: ‘payload’</p>
<p>So, for example, you’d do something like this in a <a href="https://sinatra.rubyforge.org/">Sinatra</a> server:</p>
<pre>
post '/' do
push = JSON.parse(params[:payload])
"I got some JSON: #{push.inspect}"
end
</pre>
<p>A template Rack server for the task: <a href="https://github.com/raggi/github_post_receive_server/">raggi/github_post_receive_server</a></p>
<p>Send something to <a href="https://github.com/jnewland/github-campfire/">Campfire</a>, <a href="https://github.com/webs/irccat"><span class="caps">IRC</span></a>, <a href="https://github.com/jnunemaker/github-twitter/">Twitter</a>, your CI server, whatever. It’s your data.</p>
<h2><span class="caps">JSON</span> After July 30th</h2>
<p>As of July 30th, the ‘commits’ property will contain an array – not an object.</p>
<p>Here’s an example of a <span class="caps">POST</span>’d ‘payload’ <span class="caps">JSON</span> object <strong>after</strong> July 30th:</p>
<pre>
{
"before": "5aef35982fb2d34e9d9d4502f6ede1072793222d",
"repository": {
"url": "https://github.com/defunkt/github",
"name": "github",
"owner": {
"email": "chris@ozmm.org",
"name": "defunkt"
}
},
"commits": [
{
"id": "41a212ee83ca127e3c8cf465891ab7216a705f59",
"url": "https://github.com/defunkt/github/commit/41a212ee83ca127e3c8cf465891ab7216a705f59",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "okay i give in",
"timestamp": "2008-02-15T14:57:17-08:00",
"added": ["filepath.rb"]
},
{
"id": "de8251ff97ee194a289832576287d6f8ad74e3d0",
"url": "https://github.com/defunkt/github/commit/de8251ff97ee194a289832576287d6f8ad74e3d0",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "update pricing a tad",
"timestamp": "2008-02-15T14:36:34-08:00"
}
],
"after": "de8251ff97ee194a289832576287d6f8ad74e3d0",
"ref": "refs/heads/master"
}
</pre>
<h2><span class="caps">JSON</span> Before July 30th</h2>
<p>Here’s an example of a <span class="caps">POST</span>’d ‘payload’ <span class="caps">JSON</span> object <strong>before</strong> July 30th:</p>
<pre>
{
"before": "5aef35982fb2d34e9d9d4502f6ede1072793222d",
"repository": {
"url": "https://github.com/defunkt/github",
"name": "github",
"owner": {
"email": "chris@ozmm.org",
"name": "defunkt"
}
},
"commits": {
"41a212ee83ca127e3c8cf465891ab7216a705f59": {
"url": "https://github.com/defunkt/github/commit/41a212ee83ca127e3c8cf465891ab7216a705f59",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "okay i give in",
"timestamp": "2008-02-15T14:57:17-08:00"
},
"de8251ff97ee194a289832576287d6f8ad74e3d0": {
"url": "https://github.com/defunkt/github/commit/de8251ff97ee194a289832576287d6f8ad74e3d0",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "update pricing a tad",
"timestamp": "2008-02-15T14:36:34-08:00"
}
},
"after": "de8251ff97ee194a289832576287d6f8ad74e3d0",
"ref": "refs/heads/master"
}
</pre>
<p>For more information on this technique, see the <a href="https://webhooks.pbwiki.com/">Web Hooks Wiki</a>.</p>
eventualbuddha
tag:github.com,2008:Guide/12
2008-02-15T16:33:09-08:00
2008-07-23T10:47:17-07:00
Post-Receive Hooks - version 12
Wed Jul 23 10:47:17 -0700 2008
<p><strong>Note:</strong> On July 30th, the post-receive’s <span class="caps">JSON</span> will change. See before and after examples further down the page.</p>
<p>If you supply a post-receive <span class="caps">URL</span>, GitHub will <span class="caps">POST</span> to that <span class="caps">URL</span> when someone uses <code>git push</code> on that repository.</p>
<p><img src="https://img.skitch.com/20080216-j3jkyuhaidw2wucsxbqd9angur.png"/></p>
<p>What we’ll send is <span class="caps">JSON</span> containing information about the push and the commits involved.</p>
<p>Here’s the template we use in Ruby to generate the <span class="caps">JSON</span>:</p>
<pre>
{
:before => before,
:after => after,
:ref => ref,
:commits => [{
:id => commit.id,
:message => commit.message,
:timestamp => commit.committed_date.xmlschema,
:url => commit_url,
:added => array_of_added_paths,
:removed => array_of_removed_paths,
:modified => array_of_modified_paths,
:author => {
:name => commit.author.name,
:email => commit.author.email
}
}],
:repository => {
:name => repository.name,
:url => repo_url,
:owner => {
:name => repository.owner.login,
:email => repository.owner.email
}
}
}
</pre>
<p>This is sent as a <span class="caps">POST</span> with a single parameter: ‘payload’</p>
<p>So, for example, you’d do something like this in a <a href="https://sinatra.rubyforge.org/">Sinatra</a> server:</p>
<pre>
post '/' do
push = JSON.parse(params[:payload])
"I got some JSON: #{push.inspect}"
end
</pre>
<p>A template Rack server for the task: <a href="https://github.com/raggi/github_post_receive_server/">raggi/github_post_receive_server</a></p>
<p>Send something to <a href="https://github.com/jnewland/github-campfire/">Campfire</a>, <a href="https://github.com/webs/irccat"><span class="caps">IRC</span></a>, <a href="https://github.com/jnunemaker/github-twitter/">Twitter</a>, your CI server, whatever. It’s your data.</p>
<h2><span class="caps">JSON</span> After July 30th</h2>
<p>As of July 30th, the ‘commits’ property will contain an array – not an object.</p>
<p>Here’s an example of a <span class="caps">POST</span>’d ‘payload’ <span class="caps">JSON</span> object <strong>after</strong> July 30th:</p>
<pre>
{
"before": "5aef35982fb2d34e9d9d4502f6ede1072793222d",
"repository": {
"url": "https://github.com/defunkt/github",
"name": "github",
"owner": {
"email": "chris@ozmm.org",
"name": "defunkt"
}
},
"commits": [
{
"id": "41a212ee83ca127e3c8cf465891ab7216a705f59",
"url": "https://github.com/defunkt/github/commit/41a212ee83ca127e3c8cf465891ab7216a705f59",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "okay i give in",
"timestamp": "2008-02-15T14:57:17-08:00",
"added": ["filepath.rb"]
},
{
"id": "de8251ff97ee194a289832576287d6f8ad74e3d0",
"url": "https://github.com/defunkt/github/commit/de8251ff97ee194a289832576287d6f8ad74e3d0",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "update pricing a tad",
"timestamp": "2008-02-15T14:36:34-08:00"
}
}],
"after": "de8251ff97ee194a289832576287d6f8ad74e3d0",
"ref": "refs/heads/master"
}
</pre>
<h2><span class="caps">JSON</span> Before July 30th</h2>
<p>Here’s an example of a <span class="caps">POST</span>’d ‘payload’ <span class="caps">JSON</span> object <strong>before</strong> July 30th:</p>
<pre>
{
"before": "5aef35982fb2d34e9d9d4502f6ede1072793222d",
"repository": {
"url": "https://github.com/defunkt/github",
"name": "github",
"owner": {
"email": "chris@ozmm.org",
"name": "defunkt"
}
},
"commits": {
"41a212ee83ca127e3c8cf465891ab7216a705f59": {
"url": "https://github.com/defunkt/github/commit/41a212ee83ca127e3c8cf465891ab7216a705f59",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "okay i give in",
"timestamp": "2008-02-15T14:57:17-08:00"
},
"de8251ff97ee194a289832576287d6f8ad74e3d0": {
"url": "https://github.com/defunkt/github/commit/de8251ff97ee194a289832576287d6f8ad74e3d0",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "update pricing a tad",
"timestamp": "2008-02-15T14:36:34-08:00"
}
},
"after": "de8251ff97ee194a289832576287d6f8ad74e3d0",
"ref": "refs/heads/master"
}
</pre>
<p>For more information on this technique, see the <a href="https://webhooks.pbwiki.com/">Web Hooks Wiki</a>.</p>
defunkt
tag:github.com,2008:Guide/12
2008-02-15T16:33:09-08:00
2008-07-23T10:45:18-07:00
Post-Receive Hooks - version 11
Wed Jul 23 10:45:18 -0700 2008
<p><strong>Note:</strong> On July 30th, the post-receive’s <span class="caps">JSON</span> will change. See before and after examples further down the page.</p>
<p>If you supply a post-receive <span class="caps">URL</span>, GitHub will <span class="caps">POST</span> to that <span class="caps">URL</span> when someone uses <code>git push</code> on that repository.</p>
<p><img src="https://img.skitch.com/20080216-j3jkyuhaidw2wucsxbqd9angur.png"/></p>
<p>What we’ll send is <span class="caps">JSON</span> containing information about the push and the commits involved.</p>
<p>Here’s the template we use in Ruby to generate the <span class="caps">JSON</span>:</p>
<pre>
{
:before => before,
:after => after,
:ref => ref,
:commits => [{
:id => commit.id,
:message => commit.message,
:timestamp => commit.committed_date.xmlschema,
:url => commit_url,
:added => array_of_added_paths,
:removed => array_of_removed_paths,
:modified => array_of_modified_paths,
:author => {
:name => commit.author.name,
:email => commit.author.email
}
}],
:repository => {
:name => repository.name,
:url => repo_url,
:owner => {
:name => repository.owner.login,
:email => repository.owner.email
}
}
}
</pre>
<p>This is sent as a <span class="caps">POST</span> with a single parameter: ‘payload’</p>
<p>So, for example, you’d do something like this in a <a href="https://sinatra.rubyforge.org/">Sinatra</a> server:</p>
<pre>
post '/' do
push = JSON.parse(params[:payload])
"I got some JSON: #{push.inspect}"
end
</pre>
<p>A template Rack server for the task: <a href="https://github.com/raggi/github_post_receive_server/">raggi/github_post_receive_server</a></p>
<p>Send something to <a href="https://github.com/jnewland/github-campfire/">Campfire</a>, <a href="https://github.com/webs/irccat"><span class="caps">IRC</span></a>, <a href="https://github.com/jnunemaker/github-twitter/">Twitter</a>, your CI server, whatever. It’s your data.</p>
<h3><span class="caps">JSON</span> After July 30th</h3>
<p>Here’s an example of a <span class="caps">POST</span>’d ‘payload’ <span class="caps">JSON</span> object <strong>after</strong> July 30th:</p>
<pre>
{
"before": "5aef35982fb2d34e9d9d4502f6ede1072793222d",
"repository": {
"url": "https://github.com/defunkt/github",
"name": "github",
"owner": {
"email": "chris@ozmm.org",
"name": "defunkt"
}
},
"commits": [
{
"id": "41a212ee83ca127e3c8cf465891ab7216a705f59",
"url": "https://github.com/defunkt/github/commit/41a212ee83ca127e3c8cf465891ab7216a705f59",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "okay i give in",
"timestamp": "2008-02-15T14:57:17-08:00",
"added" => ["filepath.rb"]
},
{
"id": "de8251ff97ee194a289832576287d6f8ad74e3d0",
"url": "https://github.com/defunkt/github/commit/de8251ff97ee194a289832576287d6f8ad74e3d0",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "update pricing a tad",
"timestamp": "2008-02-15T14:36:34-08:00"
}
}],
"after": "de8251ff97ee194a289832576287d6f8ad74e3d0",
"ref": "refs/heads/master"
}
</pre>
<h3><span class="caps">JSON</span> Before July 30th</h3>
<p>Here’s an example of a <span class="caps">POST</span>’d ‘payload’ <span class="caps">JSON</span> object <strong>before</strong> July 30th:</p>
<pre>
{
"before": "5aef35982fb2d34e9d9d4502f6ede1072793222d",
"repository": {
"url": "https://github.com/defunkt/github",
"name": "github",
"owner": {
"email": "chris@ozmm.org",
"name": "defunkt"
}
},
"commits": {
"41a212ee83ca127e3c8cf465891ab7216a705f59": {
"url": "https://github.com/defunkt/github/commit/41a212ee83ca127e3c8cf465891ab7216a705f59",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "okay i give in",
"timestamp": "2008-02-15T14:57:17-08:00"
},
"de8251ff97ee194a289832576287d6f8ad74e3d0": {
"url": "https://github.com/defunkt/github/commit/de8251ff97ee194a289832576287d6f8ad74e3d0",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "update pricing a tad",
"timestamp": "2008-02-15T14:36:34-08:00"
}
},
"after": "de8251ff97ee194a289832576287d6f8ad74e3d0",
"ref": "refs/heads/master"
}
</pre>
<p>For more information on this technique, see the <a href="https://webhooks.pbwiki.com/">Web Hooks Wiki</a>.</p>
defunkt
tag:github.com,2008:Guide/12
2008-02-15T16:33:09-08:00
2008-05-10T18:18:45-07:00
Post-Receive Hooks - version 10
Sat May 10 18:18:45 -0700 2008
<p>If you supply a post-receive <span class="caps">URL</span>, GitHub will <span class="caps">POST</span> to that <span class="caps">URL</span> when someone uses <code>git push</code> on that repository.</p>
<p><img src="https://img.skitch.com/20080216-j3jkyuhaidw2wucsxbqd9angur.png"/></p>
<p>What we’ll send is <span class="caps">JSON</span> containing information about the push and the commits involved.</p>
<p>Here’s the template we use in Ruby to generate the <span class="caps">JSON</span>:</p>
<pre>
{
:before => before,
:after => after,
:ref => ref,
:commits => [{
:message => commit.message,
:timestamp => commit.committed_date.xmlschema,
:url => commit_url,
:author => {
:name => commit.author.name,
:email => commit.author.email
}
}],
:repository => {
:name => repository.name,
:url => repo_url
:owner => {
:name => repository.owner.login,
:email => repository.owner.email
}
}
}
</pre>
<p>This is sent as a <span class="caps">POST</span> with a single parameter: ‘payload’</p>
<p>So, for example, you’d do something like this in a <a href="https://sinatra.rubyforge.org/">Sinatra</a> server:</p>
<pre>
post '/' do
push = JSON.parse(params[:payload])
"I got some JSON: #{push.inspect}"
end
</pre>
<p>A template Rack server for the task: <a href="https://github.com/raggi/github_post_receive_server/">raggi/github_post_receive_server</a></p>
<p>Send something to <a href="https://github.com/jnewland/github-campfire/">Campfire</a>, <a href="https://github.com/webs/irccat"><span class="caps">IRC</span></a>, <a href="https://github.com/jnunemaker/github-twitter/">Twitter</a>, your CI server, whatever. It’s your data.</p>
<p>Here’s an example of a <span class="caps">POST</span>’d ‘payload’ <span class="caps">JSON</span> object:</p>
<pre>
{
"before": "5aef35982fb2d34e9d9d4502f6ede1072793222d",
"repository": {
"url": "https://github.com/defunkt/github",
"name": "github",
"owner": {
"email": "chris@ozmm.org",
"name": "defunkt"
}
},
"commits": {
"41a212ee83ca127e3c8cf465891ab7216a705f59": {
"url": "https://github.com/defunkt/github/commit/41a212ee83ca127e3c8cf465891ab7216a705f59",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "okay i give in",
"timestamp": "2008-02-15T14:57:17-08:00"
},
"de8251ff97ee194a289832576287d6f8ad74e3d0": {
"url": "https://github.com/defunkt/github/commit/de8251ff97ee194a289832576287d6f8ad74e3d0",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "update pricing a tad",
"timestamp": "2008-02-15T14:36:34-08:00"
}
},
"after": "de8251ff97ee194a289832576287d6f8ad74e3d0",
"ref": "refs/heads/master"
}
</pre>
<p>For more information on this technique, see the <a href="https://webhooks.pbwiki.com/">Web Hooks Wiki</a>.</p>
raggi
tag:github.com,2008:Guide/12
2008-02-15T16:33:09-08:00
2008-05-10T15:11:02-07:00
Post-Receive Hooks - version 9
Sat May 10 15:11:02 -0700 2008
<p>If you supply a post-receive <span class="caps">URL</span>, GitHub will <span class="caps">POST</span> to that <span class="caps">URL</span> when someone uses <code>git push</code> on that repository.</p>
<p><img src="https://img.skitch.com/20080216-j3jkyuhaidw2wucsxbqd9angur.png"/></p>
<p>What we’ll send is <span class="caps">JSON</span> containing information about the push and the commits involved.</p>
<p>Here’s the template we use in Ruby to generate the <span class="caps">JSON</span>:</p>
<pre>
{
:before => before,
:after => after,
:ref => ref,
:commits => [{
:message => commit.message,
:timestamp => commit.committed_date.xmlschema,
:url => commit_url,
:author => {
:name => commit.author.name,
:email => commit.author.email
}
}],
:repository => {
:name => repository.name,
:url => repo_url
:owner => {
:name => repository.owner.login,
:email => repository.owner.email
}
}
}
</pre>
<p>This is sent as a <span class="caps">POST</span> with a single parameter: ‘payload’</p>
<p>So, for example, you’d do something like this in a <a href="https://sinatra.rubyforge.org/">Sinatra</a> server:</p>
<pre>
post '/' do
push = JSON.parse(params[:payload])
"I got some JSON: #{push.inspect}"
end
</pre>
<p>An example of a Rack server: <a href="https://blog.ra66i.org/archives/informatics/2008/05/10/hey-github-nice-rack/">hey-github-nice-rack</a></p>
<p>Send something to <a href="https://github.com/jnewland/github-campfire/">Campfire</a>, <a href="https://github.com/webs/irccat"><span class="caps">IRC</span></a>, <a href="https://github.com/jnunemaker/github-twitter/">Twitter</a>, your CI server, whatever. It’s your data.</p>
<p>Here’s an example of a <span class="caps">POST</span>’d ‘payload’ <span class="caps">JSON</span> object:</p>
<pre>
{
"before": "5aef35982fb2d34e9d9d4502f6ede1072793222d",
"repository": {
"url": "https://github.com/defunkt/github",
"name": "github",
"owner": {
"email": "chris@ozmm.org",
"name": "defunkt"
}
},
"commits": {
"41a212ee83ca127e3c8cf465891ab7216a705f59": {
"url": "https://github.com/defunkt/github/commit/41a212ee83ca127e3c8cf465891ab7216a705f59",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "okay i give in",
"timestamp": "2008-02-15T14:57:17-08:00"
},
"de8251ff97ee194a289832576287d6f8ad74e3d0": {
"url": "https://github.com/defunkt/github/commit/de8251ff97ee194a289832576287d6f8ad74e3d0",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "update pricing a tad",
"timestamp": "2008-02-15T14:36:34-08:00"
}
},
"after": "de8251ff97ee194a289832576287d6f8ad74e3d0",
"ref": "refs/heads/master"
}
</pre>
<p>For more information on this technique, see the <a href="https://webhooks.pbwiki.com/">Web Hooks Wiki</a>.</p>
raggi
tag:github.com,2008:Guide/12
2008-02-15T16:33:09-08:00
2008-03-30T15:24:41-07:00
Post-Receive Hooks - version 8
Sun Mar 30 15:24:41 -0700 2008
<p>If you supply a post-receive <span class="caps">URL</span>, GitHub will <span class="caps">POST</span> to that <span class="caps">URL</span> when someone uses <code>git push</code> on that repository.</p>
<p><img src="https://img.skitch.com/20080216-j3jkyuhaidw2wucsxbqd9angur.png"/></p>
<p>What we’ll send is <span class="caps">JSON</span> containing information about the push and the commits involved.</p>
<p>Here’s the template we use in Ruby to generate the <span class="caps">JSON</span>:</p>
<pre>
{
:before => before,
:after => after,
:ref => ref,
:commits => [{
:message => commit.message,
:timestamp => commit.committed_date.xmlschema,
:url => commit_url,
:author => {
:name => commit.author.name,
:email => commit.author.email
}
}],
:repository => {
:name => repository.name,
:url => repo_url
:owner => {
:name => repository.owner.login,
:email => repository.owner.email
}
}
}
</pre>
<p>This is sent as a <span class="caps">POST</span> with a single parameter: ‘payload’</p>
<p>So, for example, you’d do something like this in a <a href="https://sinatra.rubyforge.org/">Sinatra</a> server:</p>
<pre>
post '/' do
push = JSON.parse(params[:payload])
"I got some JSON: #{push.inspect}"
end
</pre>
<p>Send something to <a href="https://github.com/jnewland/github-campfire/">Campfire</a>, <a href="https://github.com/webs/irccat"><span class="caps">IRC</span></a>, <a href="https://github.com/jnunemaker/github-twitter/">Twitter</a>, your CI server, whatever. It’s your data.</p>
<p>Here’s an example of a <span class="caps">POST</span>’d ‘payload’ <span class="caps">JSON</span> object:</p>
<pre>
{
"before": "5aef35982fb2d34e9d9d4502f6ede1072793222d",
"repository": {
"url": "https://github.com/defunkt/github",
"name": "github",
"owner": {
"email": "chris@ozmm.org",
"name": "defunkt"
}
},
"commits": {
"41a212ee83ca127e3c8cf465891ab7216a705f59": {
"url": "https://github.com/defunkt/github/commit/41a212ee83ca127e3c8cf465891ab7216a705f59",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "okay i give in",
"timestamp": "2008-02-15T14:57:17-08:00"
},
"de8251ff97ee194a289832576287d6f8ad74e3d0": {
"url": "https://github.com/defunkt/github/commit/de8251ff97ee194a289832576287d6f8ad74e3d0",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "update pricing a tad",
"timestamp": "2008-02-15T14:36:34-08:00"
}
},
"after": "de8251ff97ee194a289832576287d6f8ad74e3d0",
"ref": "refs/heads/master"
}
</pre>
<p>For more information on this technique, see the <a href="https://webhooks.pbwiki.com/">Web Hooks Wiki</a>.</p>
defunkt
tag:github.com,2008:Guide/12
2008-02-15T16:33:09-08:00
2008-02-16T21:00:40-08:00
Post-Receive Hooks - version 7
Sat Feb 16 21:00:40 -0800 2008
<p>If you supply a post-receive <span class="caps">URL</span>, GitHub will <span class="caps">POST</span> to that <span class="caps">URL</span> when someone uses <code>git push</code> on that repository.</p>
<p><img src="https://img.skitch.com/20080216-j3jkyuhaidw2wucsxbqd9angur.png"/></p>
<p>What we’ll send is <span class="caps">JSON</span> containing information about the push and the commits involved.</p>
<p>Here’s the template we use in Ruby to generate the <span class="caps">JSON</span>:</p>
<pre>
{
:before => before,
:after => after,
:commits => [{
:message => commit.message,
:timestamp => commit.committed_date.xmlschema,
:url => commit_url,
:author => {
:name => commit.author.name,
:email => commit.author.email
}
}],
:repository => {
:name => repository.name,
:url => repo_url
:owner => {
:name => repository.owner.login,
:email => repository.owner.email
}
}
}
</pre>
<p>This is sent as a <span class="caps">POST</span> with a single parameter: ‘payload’</p>
<p>So, for example, you’d do something like this in a <a href="https://sinatra.rubyforge.org/">Sinatra</a> server:</p>
<pre>
post '/' do
push = JSON.parse(params[:payload])
"I got some JSON: #{push.inspect}"
end
</pre>
<p>Send something to <a href="https://github.com/jnewland/github-campfire/">Campfire</a>, <a href="https://github.com/webs/irccat"><span class="caps">IRC</span></a>, <a href="https://github.com/jnunemaker/github-twitter/">Twitter</a>, your CI server, whatever. It’s your data.</p>
<p>Here’s an example of a <span class="caps">POST</span>’d ‘payload’ <span class="caps">JSON</span> object:</p>
<pre>
{
"before": "5aef35982fb2d34e9d9d4502f6ede1072793222d",
"repository": {
"url": "https://github.com/defunkt/github",
"name": "github",
"owner": {
"email": "chris@ozmm.org",
"name": "defunkt"
}
},
"commits": {
"41a212ee83ca127e3c8cf465891ab7216a705f59": {
"url": "https://github.com/defunkt/github/commit/41a212ee83ca127e3c8cf465891ab7216a705f59",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "okay i give in",
"timestamp": "2008-02-15T14:57:17-08:00"
},
"de8251ff97ee194a289832576287d6f8ad74e3d0": {
"url": "https://github.com/defunkt/github/commit/de8251ff97ee194a289832576287d6f8ad74e3d0",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "update pricing a tad",
"timestamp": "2008-02-15T14:36:34-08:00"
}
},
"after": "de8251ff97ee194a289832576287d6f8ad74e3d0"
}
</pre>
<p>For more information on this technique, see the <a href="https://webhooks.pbwiki.com/">Web Hooks Wiki</a>.</p>
webs
tag:github.com,2008:Guide/12
2008-02-15T16:33:09-08:00
2008-02-15T20:46:47-08:00
Post-Receive Hooks - version 6
Fri Feb 15 20:46:47 -0800 2008
<p>If you supply a post-receive <span class="caps">URL</span>, GitHub will <span class="caps">POST</span> to that <span class="caps">URL</span> when someone uses <code>git push</code> on that repository.</p>
<p><img src="https://img.skitch.com/20080216-j3jkyuhaidw2wucsxbqd9angur.png"/></p>
<p>What we’ll send is <span class="caps">JSON</span> containing information about the push and the commits involved.</p>
<p>Here’s the template we use in Ruby to generate the <span class="caps">JSON</span>:</p>
<pre>
{
:before => before,
:after => after,
:commits => [{
:message => commit.message,
:timestamp => commit.committed_date.xmlschema,
:url => commit_url,
:author => {
:name => commit.author.name,
:email => commit.author.email
}
}],
:repository => {
:name => repository.name,
:url => repo_url
:owner => {
:name => repository.owner.login,
:email => repository.owner.email
}
}
}
</pre>
<p>This is sent as a <span class="caps">POST</span> with a single parameter: ‘payload’</p>
<p>So, for example, you’d do something like this in a <a href="https://sinatra.rubyforge.org/">Sinatra</a> server:</p>
<pre>
post '/' do
push = JSON.parse(params[:payload])
"I got some JSON: #{push.inspect}"
end
</pre>
<p>Send something to <a href="https://github.com/jnewland/github-campfire/">Campfire</a>, <span class="caps">IRC</span>, <a href="https://github.com/jnunemaker/github-twitter/">Twitter</a>, your CI server, whatever. It’s your data.</p>
<p>Here’s an example of a <span class="caps">POST</span>’d ‘payload’ <span class="caps">JSON</span> object:</p>
<pre>
{
"before": "5aef35982fb2d34e9d9d4502f6ede1072793222d",
"repository": {
"url": "https://github.com/defunkt/github",
"name": "github",
"owner": {
"email": "chris@ozmm.org",
"name": "defunkt"
}
},
"commits": {
"41a212ee83ca127e3c8cf465891ab7216a705f59": {
"url": "https://github.com/defunkt/github/commit/41a212ee83ca127e3c8cf465891ab7216a705f59",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "okay i give in",
"timestamp": "2008-02-15T14:57:17-08:00"
},
"de8251ff97ee194a289832576287d6f8ad74e3d0": {
"url": "https://github.com/defunkt/github/commit/de8251ff97ee194a289832576287d6f8ad74e3d0",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "update pricing a tad",
"timestamp": "2008-02-15T14:36:34-08:00"
}
},
"after": "de8251ff97ee194a289832576287d6f8ad74e3d0"
}
</pre>
<p>For more information on this technique, see the <a href="https://webhooks.pbwiki.com/">Web Hooks Wiki</a>.</p>
defunkt
tag:github.com,2008:Guide/12
2008-02-15T16:33:09-08:00
2008-02-15T20:08:41-08:00
Post-Receive Hooks - version 5
Fri Feb 15 20:08:41 -0800 2008
<p>If you supply a post-receive <span class="caps">URL</span>, GitHub will <span class="caps">POST</span> to that <span class="caps">URL</span> when someone uses <code>git push</code> on that repository.</p>
<p><img src="https://img.skitch.com/20080216-j3jkyuhaidw2wucsxbqd9angur.png"/></p>
<p>What we’ll send is <span class="caps">JSON</span> containing information about the push and the commits involved.</p>
<p>Here’s the template we use in Ruby to generate the <span class="caps">JSON</span>:</p>
<pre>
{
:before => before,
:after => after,
:commits => [{
:message => commit.message,
:timestamp => commit.committed_date.xmlschema,
:url => commit_url,
:author => {
:name => commit.author.name,
:email => commit.author.email
}
}],
:repository => {
:name => repository.name,
:url => repo_url
:owner => {
:name => repository.owner.login,
:email => repository.owner.email
}
}
}
</pre>
<p>This is sent as a <span class="caps">POST</span> with a single parameter: ‘payload’</p>
<p>So, for example, you’d do something like this in a <a href="https://sinatra.rubyforge.org/">Sinatra</a> server:</p>
<pre>
post '/' do
push = JSON.parse(params[:payload])
"I got some JSON: #{push.inspect}"
end
</pre>
<p>Send something to <a href="https://github.com/jnewland/github-campfire/">Campfire</a>, <span class="caps">IRC</span>, Twitter, your CI server, whatever. It’s your data.</p>
<p>Here’s an example of a <span class="caps">POST</span>’d ‘payload’ <span class="caps">JSON</span> object:</p>
<pre>
{
"before": "5aef35982fb2d34e9d9d4502f6ede1072793222d",
"repository": {
"url": "https://github.com/defunkt/github",
"name": "github",
"owner": {
"email": "chris@ozmm.org",
"name": "defunkt"
}
},
"commits": {
"41a212ee83ca127e3c8cf465891ab7216a705f59": {
"url": "https://github.com/defunkt/github/commit/41a212ee83ca127e3c8cf465891ab7216a705f59",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "okay i give in",
"timestamp": "2008-02-15T14:57:17-08:00"
},
"de8251ff97ee194a289832576287d6f8ad74e3d0": {
"url": "https://github.com/defunkt/github/commit/de8251ff97ee194a289832576287d6f8ad74e3d0",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "update pricing a tad",
"timestamp": "2008-02-15T14:36:34-08:00"
}
},
"after": "de8251ff97ee194a289832576287d6f8ad74e3d0"
}
</pre>
<p>For more information on this technique, see the <a href="https://webhooks.pbwiki.com/">Web Hooks Wiki</a>.</p>
defunkt
tag:github.com,2008:Guide/12
2008-02-15T16:33:09-08:00
2008-02-15T16:42:01-08:00
Post-Receive Hooks - version 4
Fri Feb 15 16:42:01 -0800 2008
<p>If you supply a post-receive <span class="caps">URL</span>, GitHub will <span class="caps">POST</span> to that <span class="caps">URL</span> when someone uses <code>git push</code> on that repository.</p>
<p><img src="https://img.skitch.com/20080216-j3jkyuhaidw2wucsxbqd9angur.png"/></p>
<p>What we’ll send is <span class="caps">JSON</span> containing information about the push and the commits involved.</p>
<p>Here’s the template we use in Ruby to generate the <span class="caps">JSON</span>:</p>
<pre>
{
:before => before,
:after => after,
:commits => [{
:message => commit.message,
:timestamp => commit.committed_date.xmlschema,
:url => commit_url,
:author => {
:name => commit.author.name,
:email => commit.author.email
}
}],
:repository => {
:name => repository.name,
:url => repo_url
:owner => {
:name => repository.owner.login,
:email => repository.owner.email
}
}
}
</pre>
<p>This is sent as a <span class="caps">POST</span> with a single parameter: ‘payload’</p>
<p>So, for example, you’d do something like this in a <a href="https://sinatra.rubyforge.org/">Sinatra</a> server:</p>
<pre>
post '/' do
push = JSON.parse(params[:payload])
"I got some JSON: #{push.inspect}"
end
</pre>
<p>Send something to Campfire, <span class="caps">IRC</span>, Twitter, your CI server, whatever. It’s your data.</p>
<p>Here’s an example of a <span class="caps">POST</span>’d ‘payload’ <span class="caps">JSON</span> object:</p>
<pre>
{
"before": "5aef35982fb2d34e9d9d4502f6ede1072793222d",
"repository": {
"url": "https://github.com/defunkt/github",
"name": "github",
"owner": {
"email": "chris@ozmm.org",
"name": "defunkt"
}
},
"commits": {
"41a212ee83ca127e3c8cf465891ab7216a705f59": {
"url": "https://github.com/defunkt/github/commit/41a212ee83ca127e3c8cf465891ab7216a705f59",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "okay i give in",
"timestamp": "2008-02-15T14:57:17-08:00"
},
"de8251ff97ee194a289832576287d6f8ad74e3d0": {
"url": "https://github.com/defunkt/github/commit/de8251ff97ee194a289832576287d6f8ad74e3d0",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "update pricing a tad",
"timestamp": "2008-02-15T14:36:34-08:00"
}
},
"after": "de8251ff97ee194a289832576287d6f8ad74e3d0"
}
</pre>
<p>For more information on this technique, see the <a href="https://webhooks.pbwiki.com/">Web Hooks Wiki</a>.</p>
defunkt
tag:github.com,2008:Guide/12
2008-02-15T16:33:09-08:00
2008-02-15T16:37:56-08:00
Post-Receive Hooks - version 3
Fri Feb 15 16:37:56 -0800 2008
<p>If you supply a post-receive <span class="caps">URL</span>, GitHub will <span class="caps">POST</span> to that <span class="caps">URL</span> when someone uses <code>git push</code> on that repository.</p>
<p><img src="https://img.skitch.com/20080216-j3jkyuhaidw2wucsxbqd9angur.png"/></p>
<p>What we’ll send is <span class="caps">JSON</span> containing information about the push and the commits involved.</p>
<p>Here’s the template we use in Ruby to generate the <span class="caps">JSON</span>:</p>
<pre>
{
:before => before,
:after => after,
:commits => [{
:message => commit.message,
:timestamp => commit.committed_date.xmlschema,
:url => commit_url,
:author => {
:name => commit.author.name,
:email => commit.author.email
}
}],
:repository => {
:name => repository.name,
:url => repo_url
:owner => {
:name => repository.owner.login,
:email => repository.owner.email
}
}
}
</pre>
<p>This is sent as a <span class="caps">POST</span> with a single parameter: ‘payload’</p>
<p>So, for example, you’d do something like this in a <a href="https://sinatra.rubyforge.org/">Sinatra</a> server:</p>
<pre>
post '/' do
push = JSON.parse(params[:payload])
"I got some JSON: #{push.inspect}"
end
</pre>
<p>Send something to Campfire, <span class="caps">IRC</span>, Twitter, your CI server, whatever. It’s your data.</p>
<p>Here’s an example of a <span class="caps">POST</span>’d ‘payload’ <span class="caps">JSON</span> object:</p>
<pre>
{
"before": "5aef35982fb2d34e9d9d4502f6ede1072793222d",
"repository": {
"url": "https://github.com/defunkt/github",
"name": "github",
"owner": {
"email": "chris@ozmm.org",
"name": "defunkt"
}
},
"commits": {
"41a212ee83ca127e3c8cf465891ab7216a705f59": {
"url": "https://github.com/defunkt/github/commit/41a212ee83ca127e3c8cf465891ab7216a705f59",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "okay i give in",
"timestamp": "2008-02-15T14:57:17-08:00"
},
"de8251ff97ee194a289832576287d6f8ad74e3d0": {
"url": "https://github.com/defunkt/github/commit/de8251ff97ee194a289832576287d6f8ad74e3d0",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "update pricing a tad",
"timestamp": "2008-02-15T14:36:34-08:00"
}
},
"after": "de8251ff97ee194a289832576287d6f8ad74e3d0"
}
</pre>
defunkt
tag:github.com,2008:Guide/12
2008-02-15T16:33:09-08:00
2008-02-15T16:37:21-08:00
Post-Receive Hooks - version 2
Fri Feb 15 16:37:21 -0800 2008
<p>If you supply a post-receive <span class="caps">URL</span>, GitHub will <span class="caps">POST</span> to that <span class="caps">URL</span> on <code>git push</code></p>
<p><img src="https://img.skitch.com/20080216-j3jkyuhaidw2wucsxbqd9angur.png"/></p>
<p>What we’ll send is <span class="caps">JSON</span> containing information about the push and the commits involved.</p>
<p>Here’s the template we use in Ruby to generate the <span class="caps">JSON</span>:</p>
<pre>
{
:before => before,
:after => after,
:commits => [{
:message => commit.message,
:timestamp => commit.committed_date.xmlschema,
:url => commit_url,
:author => {
:name => commit.author.name,
:email => commit.author.email
}
}],
:repository => {
:name => repository.name,
:url => repo_url
:owner => {
:name => repository.owner.login,
:email => repository.owner.email
}
}
}
</pre>
<p>This is sent as a <span class="caps">POST</span> with a single parameter: ‘payload’</p>
<p>So, for example, you’d do something like this in a <a href="https://sinatra.rubyforge.org/">Sinatra</a> server:</p>
<pre>
post '/' do
push = JSON.parse(params[:payload])
"I got some JSON: #{push.inspect}"
end
</pre>
<p>Send something to Campfire, <span class="caps">IRC</span>, Twitter, your CI server, whatever. It’s your data.</p>
<p>Here’s an example of a <span class="caps">POST</span>’d ‘payload’ <span class="caps">JSON</span> object:</p>
<pre>
{
"before": "5aef35982fb2d34e9d9d4502f6ede1072793222d",
"repository": {
"url": "https://github.com/defunkt/github",
"name": "github",
"owner": {
"email": "chris@ozmm.org",
"name": "defunkt"
}
},
"commits": {
"41a212ee83ca127e3c8cf465891ab7216a705f59": {
"url": "https://github.com/defunkt/github/commit/41a212ee83ca127e3c8cf465891ab7216a705f59",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "okay i give in",
"timestamp": "2008-02-15T14:57:17-08:00"
},
"de8251ff97ee194a289832576287d6f8ad74e3d0": {
"url": "https://github.com/defunkt/github/commit/de8251ff97ee194a289832576287d6f8ad74e3d0",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "update pricing a tad",
"timestamp": "2008-02-15T14:36:34-08:00"
}
},
"after": "de8251ff97ee194a289832576287d6f8ad74e3d0"
}
</pre>
defunkt
tag:github.com,2008:Guide/12
2008-02-15T16:33:09-08:00
2008-02-15T16:33:09-08:00
Post-Receive Hooks - version 1
Fri Feb 15 16:33:09 -0800 2008
<pre>
{
:before => before,
:after => after,
:commits => [{
:message => commit.message,
:timestamp => commit.committed_date.xmlschema,
:url => commit_url,
:author => {
:name => commit.author.name,
:email => commit.author.email
}
}],
:repository => {
:name => repository.name,
:owner => {
:name => repository.owner.login,
:email => repository.owner.email
},
:url => repo_url,
}
}
</pre>
<p>This is sent as a <span class="caps">POST</span> with a single parameter: ‘payload’</p>
<p>Here’s an example of a <span class="caps">POST</span>’d ‘payload’ <span class="caps">JSON</span> object:</p>
<pre>
{
"before": "5aef35982fb2d34e9d9d4502f6ede1072793222d",
"repository": {
"url": "https://github.com/defunkt/github",
"name": "github",
"owner": {
"email": "chris@ozmm.org",
"name": "defunkt"
}
},
"commits": {
"41a212ee83ca127e3c8cf465891ab7216a705f59": {
"url": "https://github.com/defunkt/github/commit/41a212ee83ca127e3c8cf465891ab7216a705f59",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "okay i give in",
"timestamp": "2008-02-15T14:57:17-08:00"
},
"de8251ff97ee194a289832576287d6f8ad74e3d0": {
"url": "https://github.com/defunkt/github/commit/de8251ff97ee194a289832576287d6f8ad74e3d0",
"author": {
"email": "chris@ozmm.org",
"name": "Chris Wanstrath"
},
"message": "update pricing a tad",
"timestamp": "2008-02-15T14:36:34-08:00"
}
},
"after": "de8251ff97ee194a289832576287d6f8ad74e3d0"
}
</pre>
defunkt