From 5e542379cf8be6bda92768034bff29c543a489a0 Mon Sep 17 00:00:00 2001 From: A_D Date: Sat, 17 Nov 2018 15:07:33 +0200 Subject: [PATCH] made sure to dump unknown events for use later --- webhooks.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/webhooks.go b/webhooks.go index a8c8db9..473ffea 100644 --- a/webhooks.go +++ b/webhooks.go @@ -112,14 +112,24 @@ func handleWebHook(writer http.ResponseWriter, request *http.Request) { default: fmt.Printf("Unknown event type: %q\n", eventType) + handleUnknown(data) return } } +func printSep() { + fmt.Println("---") +} + +func handleUnknown(data []byte) { + printSep() + fmt.Println(string(data)) +} + func handlePush(data []byte) { + printSep() pushData := Push{} json.Unmarshal(data, &pushData) - fmt.Println("---") fmt.Printf( "Got a push for repo %q owned by %q. Pushed by %q (%q)\n", pushData.Repository.FullName,