Skip to content

Commit 89cfce7

Browse files
fixed pull-request payload
1 parent 4e0be67 commit 89cfce7

File tree

3 files changed

+66
-329
lines changed

3 files changed

+66
-329
lines changed

github/payload.go

Lines changed: 37 additions & 306 deletions
Original file line numberDiff line numberDiff line change
@@ -1872,18 +1872,21 @@ type PullRequestPayload struct {
18721872
Action string `json:"action"`
18731873
Number int64 `json:"number"`
18741874
PullRequest struct {
1875-
URL string `json:"url"`
1876-
ID int64 `json:"id"`
1877-
NodeID string `json:"node_id"`
1878-
HTMLURL string `json:"html_url"`
1879-
DiffURL string `json:"diff_url"`
1880-
PatchURL string `json:"patch_url"`
1881-
IssueURL string `json:"issue_url"`
1882-
Number int64 `json:"number"`
1883-
State string `json:"state"`
1884-
Locked bool `json:"locked"`
1885-
Title string `json:"title"`
1886-
User struct {
1875+
URL string `json:"url"`
1876+
ID int64 `json:"id"`
1877+
NodeID string `json:"node_id"`
1878+
HTMLURL string `json:"html_url"`
1879+
DiffURL string `json:"diff_url"`
1880+
PatchURL string `json:"patch_url"`
1881+
IssueURL string `json:"issue_url"`
1882+
Number int64 `json:"number"`
1883+
State string `json:"state"`
1884+
Locked bool `json:"locked"`
1885+
Title string `json:"title"`
1886+
AuthorAssociation string `json:"author_association"`
1887+
Draft bool `json:"draft"`
1888+
MaintainerCanModify bool `json:"maintainer_can_modify"`
1889+
User struct {
18871890
Login string `json:"login"`
18881891
ID int64 `json:"id"`
18891892
NodeID string `json:"node_id"`
@@ -1936,7 +1939,7 @@ type PullRequestPayload struct {
19361939
ReceivedEventsURL string `json:"received_events_url"`
19371940
Type string `json:"type"`
19381941
SiteAdmin bool `json:"site_admin"`
1939-
} `json:"requested_reviewers,omitempty"`
1942+
} `json:"requested_reviewers"`
19401943
Labels []struct {
19411944
ID int64 `json:"id"`
19421945
NodeID string `json:"node_id"`
@@ -1970,95 +1973,7 @@ type PullRequestPayload struct {
19701973
Type string `json:"type"`
19711974
SiteAdmin bool `json:"site_admin"`
19721975
} `json:"user"`
1973-
Repo struct {
1974-
ID int64 `json:"id"`
1975-
NodeID string `json:"node_id"`
1976-
Name string `json:"name"`
1977-
FullName string `json:"full_name"`
1978-
Owner struct {
1979-
Login string `json:"login"`
1980-
ID int64 `json:"id"`
1981-
NodeID string `json:"node_id"`
1982-
AvatarURL string `json:"avatar_url"`
1983-
GravatarID string `json:"gravatar_id"`
1984-
URL string `json:"url"`
1985-
HTMLURL string `json:"html_url"`
1986-
FollowersURL string `json:"followers_url"`
1987-
FollowingURL string `json:"following_url"`
1988-
GistsURL string `json:"gists_url"`
1989-
StarredURL string `json:"starred_url"`
1990-
SubscriptionsURL string `json:"subscriptions_url"`
1991-
OrganizationsURL string `json:"organizations_url"`
1992-
ReposURL string `json:"repos_url"`
1993-
EventsURL string `json:"events_url"`
1994-
ReceivedEventsURL string `json:"received_events_url"`
1995-
Type string `json:"type"`
1996-
SiteAdmin bool `json:"site_admin"`
1997-
} `json:"owner"`
1998-
Private bool `json:"private"`
1999-
HTMLURL string `json:"html_url"`
2000-
Description string `json:"description"`
2001-
Fork bool `json:"fork"`
2002-
URL string `json:"url"`
2003-
ForksURL string `json:"forks_url"`
2004-
KeysURL string `json:"keys_url"`
2005-
CollaboratorsURL string `json:"collaborators_url"`
2006-
TeamsURL string `json:"teams_url"`
2007-
HooksURL string `json:"hooks_url"`
2008-
IssueEventsURL string `json:"issue_events_url"`
2009-
EventsURL string `json:"events_url"`
2010-
AssigneesURL string `json:"assignees_url"`
2011-
BranchesURL string `json:"branches_url"`
2012-
TagsURL string `json:"tags_url"`
2013-
BlobsURL string `json:"blobs_url"`
2014-
GitTagsURL string `json:"git_tags_url"`
2015-
GitRefsURL string `json:"git_refs_url"`
2016-
TreesURL string `json:"trees_url"`
2017-
StatusesURL string `json:"statuses_url"`
2018-
LanguagesURL string `json:"languages_url"`
2019-
StargazersURL string `json:"stargazers_url"`
2020-
ContributorsURL string `json:"contributors_url"`
2021-
SubscribersURL string `json:"subscribers_url"`
2022-
SubscriptionURL string `json:"subscription_url"`
2023-
CommitsURL string `json:"commits_url"`
2024-
GitCommitsURL string `json:"git_commits_url"`
2025-
CommentsURL string `json:"comments_url"`
2026-
IssueCommentURL string `json:"issue_comment_url"`
2027-
ContentsURL string `json:"contents_url"`
2028-
CompareURL string `json:"compare_url"`
2029-
MergesURL string `json:"merges_url"`
2030-
ArchiveURL string `json:"archive_url"`
2031-
DownloadsURL string `json:"downloads_url"`
2032-
IssuesURL string `json:"issues_url"`
2033-
PullsURL string `json:"pulls_url"`
2034-
MilestonesURL string `json:"milestones_url"`
2035-
NotificationsURL string `json:"notifications_url"`
2036-
LabelsURL string `json:"labels_url"`
2037-
ReleasesURL string `json:"releases_url"`
2038-
CreatedAt time.Time `json:"created_at"`
2039-
UpdatedAt time.Time `json:"updated_at"`
2040-
PushedAt time.Time `json:"pushed_at"`
2041-
GitURL string `json:"git_url"`
2042-
SSHURL string `json:"ssh_url"`
2043-
CloneURL string `json:"clone_url"`
2044-
SvnURL string `json:"svn_url"`
2045-
Homepage *string `json:"homepage"`
2046-
Size int64 `json:"size"`
2047-
StargazersCount int64 `json:"stargazers_count"`
2048-
WatchersCount int64 `json:"watchers_count"`
2049-
Language *string `json:"language"`
2050-
HasIssues bool `json:"has_issues"`
2051-
HasDownloads bool `json:"has_downloads"`
2052-
HasWiki bool `json:"has_wiki"`
2053-
HasPages bool `json:"has_pages"`
2054-
ForksCount int64 `json:"forks_count"`
2055-
MirrorURL *string `json:"mirror_url"`
2056-
OpenIssuesCount int64 `json:"open_issues_count"`
2057-
Forks int64 `json:"forks"`
2058-
OpenIssues int64 `json:"open_issues"`
2059-
Watchers int64 `json:"watchers"`
2060-
DefaultBranch string `json:"default_branch"`
2061-
} `json:"repo"`
1976+
Repo Repository `json:"repo"`
20621977
} `json:"head"`
20631978
Base struct {
20641979
Label string `json:"label"`
@@ -2084,95 +1999,7 @@ type PullRequestPayload struct {
20841999
Type string `json:"type"`
20852000
SiteAdmin bool `json:"site_admin"`
20862001
} `json:"user"`
2087-
Repo struct {
2088-
ID int64 `json:"id"`
2089-
NodeID string `json:"node_id"`
2090-
Name string `json:"name"`
2091-
FullName string `json:"full_name"`
2092-
Owner struct {
2093-
Login string `json:"login"`
2094-
ID int64 `json:"id"`
2095-
NodeID string `json:"node_id"`
2096-
AvatarURL string `json:"avatar_url"`
2097-
GravatarID string `json:"gravatar_id"`
2098-
URL string `json:"url"`
2099-
HTMLURL string `json:"html_url"`
2100-
FollowersURL string `json:"followers_url"`
2101-
FollowingURL string `json:"following_url"`
2102-
GistsURL string `json:"gists_url"`
2103-
StarredURL string `json:"starred_url"`
2104-
SubscriptionsURL string `json:"subscriptions_url"`
2105-
OrganizationsURL string `json:"organizations_url"`
2106-
ReposURL string `json:"repos_url"`
2107-
EventsURL string `json:"events_url"`
2108-
ReceivedEventsURL string `json:"received_events_url"`
2109-
Type string `json:"type"`
2110-
SiteAdmin bool `json:"site_admin"`
2111-
} `json:"owner"`
2112-
Private bool `json:"private"`
2113-
HTMLURL string `json:"html_url"`
2114-
Description string `json:"description"`
2115-
Fork bool `json:"fork"`
2116-
URL string `json:"url"`
2117-
ForksURL string `json:"forks_url"`
2118-
KeysURL string `json:"keys_url"`
2119-
CollaboratorsURL string `json:"collaborators_url"`
2120-
TeamsURL string `json:"teams_url"`
2121-
HooksURL string `json:"hooks_url"`
2122-
IssueEventsURL string `json:"issue_events_url"`
2123-
EventsURL string `json:"events_url"`
2124-
AssigneesURL string `json:"assignees_url"`
2125-
BranchesURL string `json:"branches_url"`
2126-
TagsURL string `json:"tags_url"`
2127-
BlobsURL string `json:"blobs_url"`
2128-
GitTagsURL string `json:"git_tags_url"`
2129-
GitRefsURL string `json:"git_refs_url"`
2130-
TreesURL string `json:"trees_url"`
2131-
StatusesURL string `json:"statuses_url"`
2132-
LanguagesURL string `json:"languages_url"`
2133-
StargazersURL string `json:"stargazers_url"`
2134-
ContributorsURL string `json:"contributors_url"`
2135-
SubscribersURL string `json:"subscribers_url"`
2136-
SubscriptionURL string `json:"subscription_url"`
2137-
CommitsURL string `json:"commits_url"`
2138-
GitCommitsURL string `json:"git_commits_url"`
2139-
CommentsURL string `json:"comments_url"`
2140-
IssueCommentURL string `json:"issue_comment_url"`
2141-
ContentsURL string `json:"contents_url"`
2142-
CompareURL string `json:"compare_url"`
2143-
MergesURL string `json:"merges_url"`
2144-
ArchiveURL string `json:"archive_url"`
2145-
DownloadsURL string `json:"downloads_url"`
2146-
IssuesURL string `json:"issues_url"`
2147-
PullsURL string `json:"pulls_url"`
2148-
MilestonesURL string `json:"milestones_url"`
2149-
NotificationsURL string `json:"notifications_url"`
2150-
LabelsURL string `json:"labels_url"`
2151-
ReleasesURL string `json:"releases_url"`
2152-
CreatedAt time.Time `json:"created_at"`
2153-
UpdatedAt time.Time `json:"updated_at"`
2154-
PushedAt time.Time `json:"pushed_at"`
2155-
GitURL string `json:"git_url"`
2156-
SSHURL string `json:"ssh_url"`
2157-
CloneURL string `json:"clone_url"`
2158-
SvnURL string `json:"svn_url"`
2159-
Homepage *string `json:"homepage"`
2160-
Size int64 `json:"size"`
2161-
StargazersCount int64 `json:"stargazers_count"`
2162-
WatchersCount int64 `json:"watchers_count"`
2163-
Language *string `json:"language"`
2164-
HasIssues bool `json:"has_issues"`
2165-
HasDownloads bool `json:"has_downloads"`
2166-
HasWiki bool `json:"has_wiki"`
2167-
HasPages bool `json:"has_pages"`
2168-
ForksCount int64 `json:"forks_count"`
2169-
MirrorURL *string `json:"mirror_url"`
2170-
OpenIssuesCount int64 `json:"open_issues_count"`
2171-
Forks int64 `json:"forks"`
2172-
OpenIssues int64 `json:"open_issues"`
2173-
Watchers int64 `json:"watchers"`
2174-
DefaultBranch string `json:"default_branch"`
2175-
} `json:"repo"`
2002+
Repo Repository `json:"repo"`
21762003
} `json:"base"`
21772004
Links struct {
21782005
Self struct {
@@ -2202,6 +2029,7 @@ type PullRequestPayload struct {
22022029
} `json:"_links"`
22032030
Merged bool `json:"merged"`
22042031
Mergeable *bool `json:"mergeable"`
2032+
Rebaseable *bool `json:"rebaseable"`
22052033
MergeableState string `json:"mergeable_state"`
22062034
MergedBy *MergedBy `json:"merged_by"`
22072035
Comments int64 `json:"comments"`
@@ -2210,106 +2038,22 @@ type PullRequestPayload struct {
22102038
Additions int64 `json:"additions"`
22112039
Deletions int64 `json:"deletions"`
22122040
ChangedFiles int64 `json:"changed_files"`
2041+
RequestedTeams []struct {
2042+
Name string `json:"name"`
2043+
ID int64 `json:"id"`
2044+
NodeID string `json:"node_id"`
2045+
Slug string `json:"slug"`
2046+
Description string `json:"description"`
2047+
Privacy string `json:"privacy"`
2048+
URL string `json:"url"`
2049+
HTMLURL string `json:"html_url"`
2050+
MembersURL string `json:"members_url"`
2051+
RepositoriesURL string `json:"repositories_url"`
2052+
Permission string `json:"permission"`
2053+
} `json:"requested_teams"`
22132054
} `json:"pull_request"`
2214-
Label struct {
2215-
ID int64 `json:"id"`
2216-
NodeID string `json:"node_id"`
2217-
Description string `json:"description"`
2218-
URL string `json:"url"`
2219-
Name string `json:"name"`
2220-
Color string `json:"color"`
2221-
Default bool `json:"default"`
2222-
} `json:"label"`
2223-
Repository struct {
2224-
ID int64 `json:"id"`
2225-
NodeID string `json:"node_id"`
2226-
Name string `json:"name"`
2227-
FullName string `json:"full_name"`
2228-
Owner struct {
2229-
Login string `json:"login"`
2230-
NodeID string `json:"node_id"`
2231-
ID int64 `json:"id"`
2232-
AvatarURL string `json:"avatar_url"`
2233-
GravatarID string `json:"gravatar_id"`
2234-
URL string `json:"url"`
2235-
HTMLURL string `json:"html_url"`
2236-
FollowersURL string `json:"followers_url"`
2237-
FollowingURL string `json:"following_url"`
2238-
GistsURL string `json:"gists_url"`
2239-
StarredURL string `json:"starred_url"`
2240-
SubscriptionsURL string `json:"subscriptions_url"`
2241-
OrganizationsURL string `json:"organizations_url"`
2242-
ReposURL string `json:"repos_url"`
2243-
EventsURL string `json:"events_url"`
2244-
ReceivedEventsURL string `json:"received_events_url"`
2245-
Type string `json:"type"`
2246-
SiteAdmin bool `json:"site_admin"`
2247-
} `json:"owner"`
2248-
Private bool `json:"private"`
2249-
HTMLURL string `json:"html_url"`
2250-
Description string `json:"description"`
2251-
Fork bool `json:"fork"`
2252-
URL string `json:"url"`
2253-
ForksURL string `json:"forks_url"`
2254-
KeysURL string `json:"keys_url"`
2255-
CollaboratorsURL string `json:"collaborators_url"`
2256-
TeamsURL string `json:"teams_url"`
2257-
HooksURL string `json:"hooks_url"`
2258-
IssueEventsURL string `json:"issue_events_url"`
2259-
EventsURL string `json:"events_url"`
2260-
AssigneesURL string `json:"assignees_url"`
2261-
BranchesURL string `json:"branches_url"`
2262-
TagsURL string `json:"tags_url"`
2263-
BlobsURL string `json:"blobs_url"`
2264-
GitTagsURL string `json:"git_tags_url"`
2265-
GitRefsURL string `json:"git_refs_url"`
2266-
TreesURL string `json:"trees_url"`
2267-
StatusesURL string `json:"statuses_url"`
2268-
LanguagesURL string `json:"languages_url"`
2269-
StargazersURL string `json:"stargazers_url"`
2270-
ContributorsURL string `json:"contributors_url"`
2271-
SubscribersURL string `json:"subscribers_url"`
2272-
SubscriptionURL string `json:"subscription_url"`
2273-
CommitsURL string `json:"commits_url"`
2274-
GitCommitsURL string `json:"git_commits_url"`
2275-
CommentsURL string `json:"comments_url"`
2276-
IssueCommentURL string `json:"issue_comment_url"`
2277-
ContentsURL string `json:"contents_url"`
2278-
CompareURL string `json:"compare_url"`
2279-
MergesURL string `json:"merges_url"`
2280-
ArchiveURL string `json:"archive_url"`
2281-
DownloadsURL string `json:"downloads_url"`
2282-
IssuesURL string `json:"issues_url"`
2283-
PullsURL string `json:"pulls_url"`
2284-
MilestonesURL string `json:"milestones_url"`
2285-
NotificationsURL string `json:"notifications_url"`
2286-
LabelsURL string `json:"labels_url"`
2287-
ReleasesURL string `json:"releases_url"`
2288-
CreatedAt time.Time `json:"created_at"`
2289-
UpdatedAt time.Time `json:"updated_at"`
2290-
PushedAt time.Time `json:"pushed_at"`
2291-
GitURL string `json:"git_url"`
2292-
SSHURL string `json:"ssh_url"`
2293-
CloneURL string `json:"clone_url"`
2294-
SvnURL string `json:"svn_url"`
2295-
Homepage *string `json:"homepage"`
2296-
Size int64 `json:"size"`
2297-
StargazersCount int64 `json:"stargazers_count"`
2298-
WatchersCount int64 `json:"watchers_count"`
2299-
Language *string `json:"language"`
2300-
HasIssues bool `json:"has_issues"`
2301-
HasDownloads bool `json:"has_downloads"`
2302-
HasWiki bool `json:"has_wiki"`
2303-
HasPages bool `json:"has_pages"`
2304-
ForksCount int64 `json:"forks_count"`
2305-
MirrorURL *string `json:"mirror_url"`
2306-
OpenIssuesCount int64 `json:"open_issues_count"`
2307-
Forks int64 `json:"forks"`
2308-
OpenIssues int64 `json:"open_issues"`
2309-
Watchers int64 `json:"watchers"`
2310-
DefaultBranch string `json:"default_branch"`
2311-
} `json:"repository"`
2312-
Sender struct {
2055+
Repository Repository `json:"repository"`
2056+
Sender struct {
23132057
Login string `json:"login"`
23142058
ID int64 `json:"id"`
23152059
NodeID string `json:"node_id"`
@@ -2329,23 +2073,10 @@ type PullRequestPayload struct {
23292073
Type string `json:"type"`
23302074
SiteAdmin bool `json:"site_admin"`
23312075
} `json:"sender"`
2332-
Assignee *Assignee `json:"assignee"`
2333-
RequestedReviewer *Assignee `json:"requested_reviewer"`
2334-
RequestedTeam struct {
2335-
Name string `json:"name"`
2336-
ID int64 `json:"id"`
2337-
NodeID string `json:"node_id"`
2338-
Slug string `json:"slug"`
2339-
Description string `json:"description"`
2340-
Privacy string `json:"privacy"`
2341-
URL string `json:"url"`
2342-
HTMLURL string `json:"html_url"`
2343-
MembersURL string `json:"members_url"`
2344-
RepositoriesURL string `json:"repositories_url"`
2345-
Permission string `json:"permission"`
2346-
} `json:"requested_team"`
2076+
23472077
Installation struct {
2348-
ID int64 `json:"id"`
2078+
ID int64 `json:"id"`
2079+
NodeID string `json:"node_id"`
23492080
} `json:"installation"`
23502081
}
23512082

0 commit comments

Comments
 (0)