in webhook-app/webhook_helper.py [0:0]
def process(request):
"""Calls all of the functions registered for a GitHub event."""
event = request.headers.get('X-GitHub-Event', 'ping')
functions = _web_hook_event_map[event]
data = request.get_json()
logging.info('Event: {}'.format(event))
# import json
# guid = request.headers['X-GitHub-Delivery']
# with open('payloads/{}.json'.format(guid), 'w') as f:
# json.dump(data, f, indent=2)
for function in functions:
result = function(data)
if result is not None:
return result
return {'status': 'OK'}