From cc0325f4ff0a4031f36b211408bdedbf9eb73076 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 8 Aug 2016 16:43:42 +0100 Subject: [PATCH] Explain what the ping event does --- .../matrix-org/go-neb/services/github/webhook/webhook.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/github.com/matrix-org/go-neb/services/github/webhook/webhook.go b/src/github.com/matrix-org/go-neb/services/github/webhook/webhook.go index 5d4ac9a..b70614e 100644 --- a/src/github.com/matrix-org/go-neb/services/github/webhook/webhook.go +++ b/src/github.com/matrix-org/go-neb/services/github/webhook/webhook.go @@ -54,6 +54,9 @@ func OnReceiveRequest(r *http.Request, secretToken string) (string, *github.Repo }).Print("Received Github event") if eventType == "ping" { + // Github will send a "ping" event when the webhook is first created. We need + // to return a 200 in order for the webhook to be marked as "up" (this doesn't + // affect delivery, just the tick/cross status flag). return "", nil, nil, &errors.HTTPError{nil, "pong", 200} }