From ef305446ee7866ae75e9f398fc51b3f573a67d4d Mon Sep 17 00:00:00 2001 From: yinxulai Date: Tue, 28 Apr 2020 09:47:11 +0800 Subject: [PATCH 1/3] add changes field in to GitHub PullRequestPayload. --- github/payload.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/github/payload.go b/github/payload.go index d64308f..2142634 100644 --- a/github/payload.go +++ b/github/payload.go @@ -3544,6 +3544,15 @@ type PublicPayload struct { } `json:"sender"` } +type PullRequestChanges struct { + Title *struct { + From string `json:"from"` + } `json:"title"` + Body *struct { + From string `json:"from"` + } `json:"body"` +} + // PullRequestPayload contains the information for GitHub's pull_request hook event type PullRequestPayload struct { Action string `json:"action"` @@ -4006,8 +4015,9 @@ type PullRequestPayload struct { Type string `json:"type"` SiteAdmin bool `json:"site_admin"` } `json:"sender"` - Assignee *Assignee `json:"assignee"` - RequestedReviewer *Assignee `json:"requested_reviewer"` + Changes *PullRequestChanges `json:"changes"` + Assignee *Assignee `json:"assignee"` + RequestedReviewer *Assignee `json:"requested_reviewer"` RequestedTeam struct { Name string `json:"name"` ID int64 `json:"id"` From e01b0fd664398b74f7aad88e3f921a800017cb76 Mon Sep 17 00:00:00 2001 From: yinxulai Date: Tue, 28 Apr 2020 09:54:53 +0800 Subject: [PATCH 2/3] supplementary annotation --- github/payload.go | 1 + 1 file changed, 1 insertion(+) diff --git a/github/payload.go b/github/payload.go index 2142634..2104fec 100644 --- a/github/payload.go +++ b/github/payload.go @@ -3544,6 +3544,7 @@ type PublicPayload struct { } `json:"sender"` } +// PullRequestChanges contains the information for GitHub's pull_request hook event type PullRequestChanges struct { Title *struct { From string `json:"from"` From 260e9b3afd96526d12b3096a9cf90947b444527a Mon Sep 17 00:00:00 2001 From: yinxulai Date: Tue, 28 Apr 2020 09:57:19 +0800 Subject: [PATCH 3/3] restructuring --- github/payload.go | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/github/payload.go b/github/payload.go index 2104fec..67c16a5 100644 --- a/github/payload.go +++ b/github/payload.go @@ -3544,16 +3544,6 @@ type PublicPayload struct { } `json:"sender"` } -// PullRequestChanges contains the information for GitHub's pull_request hook event -type PullRequestChanges struct { - Title *struct { - From string `json:"from"` - } `json:"title"` - Body *struct { - From string `json:"from"` - } `json:"body"` -} - // PullRequestPayload contains the information for GitHub's pull_request hook event type PullRequestPayload struct { Action string `json:"action"` @@ -4016,9 +4006,16 @@ type PullRequestPayload struct { Type string `json:"type"` SiteAdmin bool `json:"site_admin"` } `json:"sender"` - Changes *PullRequestChanges `json:"changes"` - Assignee *Assignee `json:"assignee"` - RequestedReviewer *Assignee `json:"requested_reviewer"` + Changes *struct { + Title *struct { + From string `json:"from"` + } `json:"title"` + Body *struct { + From string `json:"from"` + } `json:"body"` + } `json:"changes"` + Assignee *Assignee `json:"assignee"` + RequestedReviewer *Assignee `json:"requested_reviewer"` RequestedTeam struct { Name string `json:"name"` ID int64 `json:"id"`