Add separate payload type for confidential issues
This commit is contained in:
+4
-2
@@ -114,8 +114,10 @@ func (hook Webhook) ParsePayload(w http.ResponseWriter, r *http.Request) {
|
|||||||
hook.runProcessPayloadFunc(fn, te, hd)
|
hook.runProcessPayloadFunc(fn, te, hd)
|
||||||
|
|
||||||
case ConfidentialIssuesEvents:
|
case ConfidentialIssuesEvents:
|
||||||
// Confidential issues have the same payload as normal issues.
|
var cie ConfidentialIssueEventPayload
|
||||||
fallthrough
|
json.Unmarshal([]byte(payload), &cie)
|
||||||
|
hook.runProcessPayloadFunc(fn, cie, hd)
|
||||||
|
|
||||||
case IssuesEvents:
|
case IssuesEvents:
|
||||||
var ie IssueEventPayload
|
var ie IssueEventPayload
|
||||||
json.Unmarshal([]byte(payload), &ie)
|
json.Unmarshal([]byte(payload), &ie)
|
||||||
|
|||||||
@@ -40,6 +40,13 @@ type IssueEventPayload struct {
|
|||||||
Assignee Assignee `json:"assignee"`
|
Assignee Assignee `json:"assignee"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ConfidentialIssueEventPayload contains the information for GitLab's confidential issue event
|
||||||
|
type ConfidentialIssueEventPayload struct {
|
||||||
|
// The data for confidential issues is currently the same as normal issues,
|
||||||
|
// so we can just embed the normal issue payload type here.
|
||||||
|
IssueEventPayload
|
||||||
|
}
|
||||||
|
|
||||||
// MergeRequestEventPayload contains the information for GitLab's merge request event
|
// MergeRequestEventPayload contains the information for GitLab's merge request event
|
||||||
type MergeRequestEventPayload struct {
|
type MergeRequestEventPayload struct {
|
||||||
ObjectKind string `json:"object_kind"`
|
ObjectKind string `json:"object_kind"`
|
||||||
|
|||||||
Reference in New Issue
Block a user