From 98fab03664949412c463c8fd68244819fb22efc2 Mon Sep 17 00:00:00 2001 From: motatoes Date: Fri, 22 Nov 2024 17:59:14 +0000 Subject: [PATCH] fix npe in webhook that was accidental --- next/controllers/github.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/next/controllers/github.go b/next/controllers/github.go index a28fb315a..255fb6007 100644 --- a/next/controllers/github.go +++ b/next/controllers/github.go @@ -68,11 +68,14 @@ func (d DiggerController) GithubAppWebHook(c *gin.Context) { if *event.Action == "deleted" { err := handleInstallationDeletedEvent(event) if err != nil { - c.String(http.StatusInternalServerError, "Failed to handle webhook event.") + log.Printf("Failed to handle webhook event. %v", err) return } } + c.String(http.StatusAccepted, "ok") + return + case *github.IssueCommentEvent: log.Printf("IssueCommentEvent, action: %v\n", *event.Action) case *github.PullRequestEvent: @@ -81,7 +84,7 @@ func (d DiggerController) GithubAppWebHook(c *gin.Context) { if err != nil { log.Printf("handlePullRequestEvent error: %v", err) } - c.String(http.StatusAccepted, err.Error()) + c.String(http.StatusAccepted, "ok") return case *github.PushEvent: @@ -90,7 +93,7 @@ func (d DiggerController) GithubAppWebHook(c *gin.Context) { if err != nil { log.Printf("handlePushEvent error: %v", err) } - c.String(http.StatusAccepted, err.Error()) + c.String(http.StatusAccepted, "ok") return default: