File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,20 +34,23 @@ def error_cleanup():
3434@app .route ("/api/github-webhook" , methods = ["POST" ])
3535def github_webhook ():
3636 try :
37+ # This UUID can be found under the Github WebHook settings
38+ # "Recent Deliveries" tab, with all the details and our
39+ # response.
40+ event_uuid = request .headers .get ("X-Github-Delivery" )
3741 event_type = request .headers .get ("X-Github-Event" )
3842 event = request .json
39- logging .info ("Github webhook: type = %s, payload = %s" , event_type , event )
43+ logging .info ("Github webhook: delivery = %s, type = %s" , event_uuid , event_type )
4044 if event_type == "workflow_job" :
4145 cfbot_github .ingest_workflow_job (conn , event )
4246 conn .commit ()
4347 return "OK"
4448 elif event_type == "workflow_run" :
45- # XXX Not used yet...
4649 cfbot_github .ingest_workflow_run (conn , event )
4750 conn .commit ()
4851 return "OK"
4952 else :
50- return "not understood"
53+ return "unhandled event type " + event_type
5154 except :
5255 error_cleanup ()
5356 logging .exception ("Error processing webhook" )
You can’t perform that action at this time.
0 commit comments