Skip to content

Commit 59caccc

Browse files
authored
fix npe in webhook that was accidental (#1845)
1 parent 662bddf commit 59caccc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

next/controllers/github.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,14 @@ func (d DiggerController) GithubAppWebHook(c *gin.Context) {
6868
if *event.Action == "deleted" {
6969
err := handleInstallationDeletedEvent(event)
7070
if err != nil {
71-
c.String(http.StatusInternalServerError, "Failed to handle webhook event.")
71+
log.Printf("Failed to handle webhook event. %v", err)
7272
return
7373
}
7474
}
7575

76+
c.String(http.StatusAccepted, "ok")
77+
return
78+
7679
case *github.IssueCommentEvent:
7780
log.Printf("IssueCommentEvent, action: %v\n", *event.Action)
7881
case *github.PullRequestEvent:
@@ -81,7 +84,7 @@ func (d DiggerController) GithubAppWebHook(c *gin.Context) {
8184
if err != nil {
8285
log.Printf("handlePullRequestEvent error: %v", err)
8386
}
84-
c.String(http.StatusAccepted, err.Error())
87+
c.String(http.StatusAccepted, "ok")
8588
return
8689

8790
case *github.PushEvent:
@@ -90,7 +93,7 @@ func (d DiggerController) GithubAppWebHook(c *gin.Context) {
9093
if err != nil {
9194
log.Printf("handlePushEvent error: %v", err)
9295
}
93-
c.String(http.StatusAccepted, err.Error())
96+
c.String(http.StatusAccepted, "ok")
9497
return
9598

9699
default:

0 commit comments

Comments
 (0)