made sure to dump unknown events for use later

This commit is contained in:
A_D 2018-11-17 15:07:33 +02:00
parent 799c07d43a
commit 5e542379cf
No known key found for this signature in database
GPG Key ID: C242F3DD220FA945
1 changed files with 11 additions and 1 deletions

View File

@ -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,