@register_hook
def github_hook_helper(data):
 owner = data['repository']['owner']['name']
 slug = data['repository']['name']
 branch = re.sub('^refs/heads/', '', data['ref'])
 params = {'owner': owner, 'slug': slug}
 repos = [(repo % params) for repo in GITHUB_REPOS]
 return {'service_long_name': 'GitHub', 'repo_url': data['repository']['url'], 'repos': repos, 'branch': branch}

@ register_hook def github_hook_helper ( data ) : owner = data [ 'repository' ] [ 'owner' ] [ 'name' ] slug = data [ 'repository' ] [ 'name' ] branch = re . sub ( '^refs/heads/' , '' , data [ 'ref' ] ) params = { 'owner' : owner , 'slug' : slug } repos = [ ( repo % params ) for repo in GITHUB_REPOS ] return { 'service_long_name' : 'GitHub' , 'repo_url' : data [ 'repository' ] [ 'url' ] , 'repos' : repos , 'branch' : branch }
api to handle commit hooks from github .