Skip to content

Commit 9435dc8

Browse files
fixed label payload
1 parent ef75901 commit 9435dc8

File tree

2 files changed

+16
-116
lines changed

2 files changed

+16
-116
lines changed

github/payload.go

Lines changed: 11 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,118 +1022,17 @@ type IssuesPayload struct {
10221022
type LabelPayload struct {
10231023
Action string `json:"action"`
10241024
Label struct {
1025-
ID int64 `json:"id"`
1026-
NodeID string `json:"node_id"`
1027-
Description string `json:"description"`
1028-
URL string `json:"url"`
1029-
Name string `json:"name"`
1030-
Color string `json:"color"`
1025+
ID int64 `json:"id"`
1026+
NodeID string `json:"node_id"`
1027+
// TODO check if label.description has to go away
1028+
// Description string `json:"description"`
1029+
URL string `json:"url"`
1030+
Name string `json:"name"`
1031+
Color string `json:"color"`
1032+
Default bool `json:"default"`
10311033
} `json:"label"`
1032-
Repository struct {
1033-
ID int64 `json:"id"`
1034-
NodeID string `json:"node_id"`
1035-
Name string `json:"name"`
1036-
FullName string `json:"full_name"`
1037-
Owner struct {
1038-
Login string `json:"login"`
1039-
ID int64 `json:"id"`
1040-
NodeID string `json:"node_id"`
1041-
AvatarURL string `json:"avatar_url"`
1042-
GravatarID string `json:"gravatar_id"`
1043-
URL string `json:"url"`
1044-
HTMLURL string `json:"html_url"`
1045-
FollowersURL string `json:"followers_url"`
1046-
FollowingURL string `json:"following_url"`
1047-
GistsURL string `json:"gists_url"`
1048-
StarredURL string `json:"starred_url"`
1049-
SubscriptionsURL string `json:"subscriptions_url"`
1050-
OrganizationsURL string `json:"organizations_url"`
1051-
ReposURL string `json:"repos_url"`
1052-
EventsURL string `json:"events_url"`
1053-
ReceivedEventsURL string `json:"received_events_url"`
1054-
Type string `json:"type"`
1055-
SiteAdmin bool `json:"site_admin"`
1056-
} `json:"owner"`
1057-
Private bool `json:"private"`
1058-
HTMLURL string `json:"html_url"`
1059-
Description *string `json:"description"`
1060-
Fork bool `json:"fork"`
1061-
URL string `json:"url"`
1062-
ForksURL string `json:"forks_url"`
1063-
KeysURL string `json:"keys_url"`
1064-
CollaboratorsURL string `json:"collaborators_url"`
1065-
TeamsURL string `json:"teams_url"`
1066-
HooksURL string `json:"hooks_url"`
1067-
IssueEventsURL string `json:"issue_events_url"`
1068-
EventsURL string `json:"events_url"`
1069-
AssigneesURL string `json:"assignees_url"`
1070-
BranchesURL string `json:"branches_url"`
1071-
TagsURL string `json:"tags_url"`
1072-
BlobsURL string `json:"blobs_url"`
1073-
GitTagsURL string `json:"git_tags_url"`
1074-
GitRefsURL string `json:"git_refs_url"`
1075-
TreesURL string `json:"trees_url"`
1076-
StatusesURL string `json:"statuses_url"`
1077-
LanguagesURL string `json:"languages_url"`
1078-
StargazersURL string `json:"stargazers_url"`
1079-
ContributorsURL string `json:"contributors_url"`
1080-
SubscribersURL string `json:"subscribers_url"`
1081-
SubscriptionURL string `json:"subscription_url"`
1082-
CommitsURL string `json:"commits_url"`
1083-
GitCommitsURL string `json:"git_commits_url"`
1084-
CommentsURL string `json:"comments_url"`
1085-
IssueCommentURL string `json:"issue_comment_url"`
1086-
ContentsURL string `json:"contents_url"`
1087-
CompareURL string `json:"compare_url"`
1088-
MergesURL string `json:"merges_url"`
1089-
ArchiveURL string `json:"archive_url"`
1090-
DownloadsURL string `json:"downloads_url"`
1091-
IssuesURL string `json:"issues_url"`
1092-
PullsURL string `json:"pulls_url"`
1093-
MilestonesURL string `json:"milestones_url"`
1094-
NotificationsURL string `json:"notifications_url"`
1095-
LabelsURL string `json:"labels_url"`
1096-
ReleasesURL string `json:"releases_url"`
1097-
DeploymentsURL string `json:"deployments_url"`
1098-
CreatedAt time.Time `json:"created_at"`
1099-
UpdatedAt time.Time `json:"updated_at"`
1100-
PushedAt time.Time `json:"pushed_at"`
1101-
GitURL string `json:"git_url"`
1102-
SSHURL string `json:"ssh_url"`
1103-
CloneURL string `json:"clone_url"`
1104-
SvnURL string `json:"svn_url"`
1105-
Homepage *string `json:"homepage"`
1106-
Size int64 `json:"size"`
1107-
StargazersCount int64 `json:"stargazers_count"`
1108-
WatchersCount int64 `json:"watchers_count"`
1109-
Language *string `json:"language"`
1110-
HasIssues bool `json:"has_issues"`
1111-
HasDownloads bool `json:"has_downloads"`
1112-
HasWiki bool `json:"has_wiki"`
1113-
HasPages bool `json:"has_pages"`
1114-
ForksCount int64 `json:"forks_count"`
1115-
MirrorURL *string `json:"mirror_url"`
1116-
OpenIssuesCount int64 `json:"open_issues_count"`
1117-
Forks int64 `json:"forks"`
1118-
OpenIssues int64 `json:"open_issues"`
1119-
Watchers int64 `json:"watchers"`
1120-
DefaultBranch string `json:"default_branch"`
1121-
} `json:"repository"`
1122-
Organization struct {
1123-
Login string `json:"login"`
1124-
ID int64 `json:"id"`
1125-
NodeID string `json:"node_id"`
1126-
URL string `json:"url"`
1127-
ReposURL string `json:"repos_url"`
1128-
EventsURL string `json:"events_url"`
1129-
HooksURL string `json:"hooks_url"`
1130-
IssuesURL string `json:"issues_url"`
1131-
MembersURL string `json:"members_url"`
1132-
PublicMembersURL string `json:"public_members_url"`
1133-
AvatarURL string `json:"avatar_url"`
1134-
Description string `json:"description"`
1135-
} `json:"organization"`
1136-
Sender struct {
1034+
Repository Repository `json:"repository"`
1035+
Sender struct {
11371036
Login string `json:"login"`
11381037
ID int64 `json:"id"`
11391038
NodeID string `json:"node_id"`
@@ -1153,6 +1052,7 @@ type LabelPayload struct {
11531052
Type string `json:"type"`
11541053
SiteAdmin bool `json:"site_admin"`
11551054
} `json:"sender"`
1055+
Installation Installation `json:"installation"`
11561056
}
11571057

11581058
// MemberPayload contains the information for GitHub's member hook event

github/payload_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ func TestPayloads(t *testing.T) {
9999
filename: "label.json",
100100
typ: &LabelPayload{},
101101
},
102-
// {
103-
// name: "MemberPayload",
104-
// filename: "member.json",
105-
// typ: &MemberPayload{},
106-
// },
102+
{
103+
name: "MemberPayload",
104+
filename: "member.json",
105+
typ: &MemberPayload{},
106+
},
107107
// {
108108
// name: "MembershipPayload",
109109
// filename: "membership.json",

0 commit comments

Comments
 (0)