Skip to content

Commit 13e6611

Browse files
committed
Add separate payload type for confidential issues
1 parent b9424ab commit 13e6611

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

gitlab/gitlab.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,10 @@ func (hook Webhook) ParsePayload(w http.ResponseWriter, r *http.Request) {
114114
hook.runProcessPayloadFunc(fn, te, hd)
115115

116116
case ConfidentialIssuesEvents:
117-
// Confidential issues have the same payload as normal issues.
118-
fallthrough
117+
var cie ConfidentialIssueEventPayload
118+
json.Unmarshal([]byte(payload), &cie)
119+
hook.runProcessPayloadFunc(fn, cie, hd)
120+
119121
case IssuesEvents:
120122
var ie IssueEventPayload
121123
json.Unmarshal([]byte(payload), &ie)

gitlab/payload.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ type IssueEventPayload struct {
4040
Assignee Assignee `json:"assignee"`
4141
}
4242

43+
// ConfidentialIssueEventPayload contains the information for GitLab's confidential issue event
44+
type ConfidentialIssueEventPayload struct {
45+
// The data for confidential issues is currently the same as normal issues,
46+
// so we can just embed the normal issue payload type here.
47+
IssueEventPayload
48+
}
49+
4350
// MergeRequestEventPayload contains the information for GitLab's merge request event
4451
type MergeRequestEventPayload struct {
4552
ObjectKind string `json:"object_kind"`

0 commit comments

Comments
 (0)