From 62851de3c44345262713e3b41845af72881ce62c Mon Sep 17 00:00:00 2001 From: Joshua Fish Date: Thu, 13 Jul 2023 13:24:31 +1000 Subject: [PATCH 1/4] Add Installation struct to CommitCommentPayload, IssueCommentPayload and IssuesPayload --- github/payload.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/github/payload.go b/github/payload.go index a544fbb..a7323b7 100644 --- a/github/payload.go +++ b/github/payload.go @@ -533,6 +533,9 @@ type CommitCommentPayload struct { Type string `json:"type"` SiteAdmin bool `json:"site_admin"` } `json:"sender"` + Installation struct { + ID int64 `json:"id"` + } `json:"installation"` } // CreatePayload contains the information for GitHub's create hook event @@ -2117,6 +2120,9 @@ type IssueCommentPayload struct { Type string `json:"type"` SiteAdmin bool `json:"site_admin"` } `json:"sender"` + Installation struct { + ID int64 `json:"id"` + } `json:"installation"` } // IssuesPayload contains the information for GitHub's issues hook event @@ -2289,6 +2295,9 @@ type IssuesPayload struct { Type string `json:"type"` SiteAdmin bool `json:"site_admin"` } `json:"sender"` + Installation struct { + ID int64 `json:"id"` + } `json:"installation"` Assignee *Assignee `json:"assignee"` Label *Label `json:"label"` } From f377fcddd33b0e283048bd90421a7abdbc04827a Mon Sep 17 00:00:00 2001 From: Joshua Fish Date: Fri, 14 Jul 2023 13:23:32 +1000 Subject: [PATCH 2/4] added omitempty to installation structs --- github/payload.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/github/payload.go b/github/payload.go index a7323b7..8e89fe5 100644 --- a/github/payload.go +++ b/github/payload.go @@ -535,7 +535,7 @@ type CommitCommentPayload struct { } `json:"sender"` Installation struct { ID int64 `json:"id"` - } `json:"installation"` + } `json:"installation,omitempty"` } // CreatePayload contains the information for GitHub's create hook event @@ -2122,7 +2122,7 @@ type IssueCommentPayload struct { } `json:"sender"` Installation struct { ID int64 `json:"id"` - } `json:"installation"` + } `json:"installation,omitempty"` } // IssuesPayload contains the information for GitHub's issues hook event @@ -2297,7 +2297,7 @@ type IssuesPayload struct { } `json:"sender"` Installation struct { ID int64 `json:"id"` - } `json:"installation"` + } `json:"installation,omitempty"` Assignee *Assignee `json:"assignee"` Label *Label `json:"label"` } From 6c7ea811a1bfdac017dc93b1720d7f05a9a28d23 Mon Sep 17 00:00:00 2001 From: Joshua Fish Date: Thu, 3 Aug 2023 11:09:01 +1000 Subject: [PATCH 3/4] added pointer to struct and removed omitempty --- github/payload.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/github/payload.go b/github/payload.go index 8e89fe5..7814c5c 100644 --- a/github/payload.go +++ b/github/payload.go @@ -187,9 +187,9 @@ type CheckRunPayload struct { Watchers int64 `json:"watchers"` DefaultBranch string `json:"default_branch"` } `json:"repository"` - Installation struct { + Installation *struct { ID int64 `json:"id"` - } `json:"installation,omitempty"` + } `json:"installation"` Sender struct { Login string `json:"login"` ID int64 `json:"id"` @@ -362,9 +362,9 @@ type CheckSuitePayload struct { Watchers int64 `json:"watchers"` DefaultBranch string `json:"default_branch"` } `json:"repository"` - Installation struct { + Installation *struct { ID int64 `json:"id"` - } `json:"installation,omitempty"` + } `json:"installation"` Sender struct { Login string `json:"login"` ID int64 `json:"id"` @@ -533,9 +533,9 @@ type CommitCommentPayload struct { Type string `json:"type"` SiteAdmin bool `json:"site_admin"` } `json:"sender"` - Installation struct { + Installation *struct { ID int64 `json:"id"` - } `json:"installation,omitempty"` + } `json:"installation"` } // CreatePayload contains the information for GitHub's create hook event @@ -2120,9 +2120,9 @@ type IssueCommentPayload struct { Type string `json:"type"` SiteAdmin bool `json:"site_admin"` } `json:"sender"` - Installation struct { + Installation *struct { ID int64 `json:"id"` - } `json:"installation,omitempty"` + } `json:"installation"` } // IssuesPayload contains the information for GitHub's issues hook event @@ -2295,9 +2295,9 @@ type IssuesPayload struct { Type string `json:"type"` SiteAdmin bool `json:"site_admin"` } `json:"sender"` - Installation struct { + Installation *struct { ID int64 `json:"id"` - } `json:"installation,omitempty"` + } `json:"installation"` Assignee *Assignee `json:"assignee"` Label *Label `json:"label"` } From e8574e3b74b39cdfede08aacb24d2bf279e9d5a0 Mon Sep 17 00:00:00 2001 From: Joshua Fish Date: Thu, 3 Aug 2023 11:11:00 +1000 Subject: [PATCH 4/4] revert changes to wrong structs --- github/payload.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/github/payload.go b/github/payload.go index 7814c5c..8b95ba8 100644 --- a/github/payload.go +++ b/github/payload.go @@ -187,9 +187,9 @@ type CheckRunPayload struct { Watchers int64 `json:"watchers"` DefaultBranch string `json:"default_branch"` } `json:"repository"` - Installation *struct { + Installation struct { ID int64 `json:"id"` - } `json:"installation"` + } `json:"installation,omitempty"` Sender struct { Login string `json:"login"` ID int64 `json:"id"` @@ -362,9 +362,9 @@ type CheckSuitePayload struct { Watchers int64 `json:"watchers"` DefaultBranch string `json:"default_branch"` } `json:"repository"` - Installation *struct { + Installation struct { ID int64 `json:"id"` - } `json:"installation"` + } `json:"installation,omitempty"` Sender struct { Login string `json:"login"` ID int64 `json:"id"`