From 5be09cefe2c72e5e7ec911e728d187132a1e74b7 Mon Sep 17 00:00:00 2001 From: Tyler Rivera Date: Wed, 13 May 2020 17:37:18 -0400 Subject: [PATCH 1/2] Support GitHub child teams --- github/payload.go | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/github/payload.go b/github/payload.go index 67c16a5..a521280 100644 --- a/github/payload.go +++ b/github/payload.go @@ -2254,16 +2254,7 @@ type MembershipPayload struct { Type string `json:"type"` SiteAdmin bool `json:"site_admin"` } `json:"sender"` - Team struct { - Name string `json:"name"` - ID int64 `json:"id"` - NodeID string `json:"node_id"` - Slug string `json:"slug"` - Permission string `json:"permission"` - URL string `json:"url"` - MembersURL string `json:"members_url"` - RepositoriesURL string `json:"repositories_url"` - } `json:"team"` + Team *Team `json:"team"` Organization struct { Login string `json:"login"` ID int64 `json:"id"` @@ -5729,17 +5720,7 @@ type TeamPayload struct { // TeamAddPayload contains the information for GitHub's team_add hook event type TeamAddPayload struct { - Team struct { - Name string `json:"name"` - ID int64 `json:"id"` - NodeID string `json:"node_id"` - Slug string `json:"slug"` - Description string `json:"description"` - Permission string `json:"permission"` - URL string `json:"url"` - MembersURL string `json:"members_url"` - RepositoriesURL string `json:"repositories_url"` - } `json:"team"` + Team *Team `json:"team"` Repository struct { ID int64 `json:"id"` NodeID string `json:"node_id"` @@ -6111,3 +6092,16 @@ type Label struct { Color string `json:"color"` Default bool `json:"default"` } + +// Team contains GitHub's Team information +type Team struct { + Name string `json:"name"` + ID int64 `json:"id"` + NodeID string `json:"node_id"` + Slug string `json:"slug"` + Permission string `json:"permission"` + URL string `json:"url"` + MembersURL string `json:"members_url"` + RepositoriesURL string `json:"repositories_url"` + Parent *Team `json:"parent,omitempty"` +} From c31b74320c7c365fc306a0af8780eb7ebad3006a Mon Sep 17 00:00:00 2001 From: Tyler Rivera Date: Thu, 14 May 2020 11:58:05 -0400 Subject: [PATCH 2/2] Support GitHub child teams in team payload --- github/payload.go | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/github/payload.go b/github/payload.go index a521280..7c5962a 100644 --- a/github/payload.go +++ b/github/payload.go @@ -5669,19 +5669,8 @@ type StatusPayload struct { // TeamPayload contains the information for GitHub's team hook event type TeamPayload struct { - Action string `json:"action"` - Team struct { - Name string `json:"name"` - ID int64 `json:"id"` - NodeID string `json:"node_id"` - Slug string `json:"slug"` - Description string `json:"description"` - Privacy string `json:"privacy"` - URL string `json:"url"` - MembersURL string `json:"members_url"` - RepositoriesURL string `json:"repositories_url"` - Permission string `json:"permission"` - } `json:"team"` + Action string `json:"action"` + Team *Team `json:"team"` Organization struct { Login string `json:"login"` ID int64 `json:"id"`