From b9424ab72e2ebbdad66f1f381392597da4726284 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sun, 1 Oct 2017 13:56:19 +0300 Subject: [PATCH] Add support for confidential GitLab issues --- gitlab/gitlab.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/gitlab/gitlab.go b/gitlab/gitlab.go index 8b1ef08..865f97a 100644 --- a/gitlab/gitlab.go +++ b/gitlab/gitlab.go @@ -26,14 +26,15 @@ type Event string // GitLab hook types const ( - PushEvents Event = "Push Hook" - TagEvents Event = "Tag Push Hook" - IssuesEvents Event = "Issue Hook" - CommentEvents Event = "Note Hook" - MergeRequestEvents Event = "Merge Request Hook" - WikiPageEvents Event = "Wiki Page Hook" - PipelineEvents Event = "Pipeline Hook" - BuildEvents Event = "Build Hook" + PushEvents Event = "Push Hook" + TagEvents Event = "Tag Push Hook" + IssuesEvents Event = "Issue Hook" + ConfidentialIssuesEvents Event = "Confidential Issue Hook" + CommentEvents Event = "Note Hook" + MergeRequestEvents Event = "Merge Request Hook" + WikiPageEvents Event = "Wiki Page Hook" + PipelineEvents Event = "Pipeline Hook" + BuildEvents Event = "Build Hook" ) // New creates and returns a WebHook instance denoted by the Provider type @@ -112,6 +113,9 @@ func (hook Webhook) ParsePayload(w http.ResponseWriter, r *http.Request) { json.Unmarshal([]byte(payload), &te) hook.runProcessPayloadFunc(fn, te, hd) + case ConfidentialIssuesEvents: + // Confidential issues have the same payload as normal issues. + fallthrough case IssuesEvents: var ie IssueEventPayload json.Unmarshal([]byte(payload), &ie)