diff --git a/github/event_types.go b/github/event_types.go index 288b89ef4a3..df45ffbac3b 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -1210,18 +1210,21 @@ type PullRequestEvent struct { PerformedViaGithubApp *App `json:"performed_via_github_app,omitempty"` } -// PullRequestReviewEvent is triggered when a review is submitted on a pull -// request. +// PullRequestReviewEvent is triggered when a review on a pull request is +// submitted, edited, or dismissed. // The Webhook event name is "pull_request_review". // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review type PullRequestReviewEvent struct { - // Action is always "submitted". + // Action is the action that was performed on the review. + // Possible values are: "submitted", "edited", "dismissed". Action *string `json:"action,omitempty"` Review *PullRequestReview `json:"review,omitempty"` PullRequest *PullRequest `json:"pull_request,omitempty"` // The following fields are only populated by Webhook events. + // Changes is populated in "edited" event deliveries. + Changes *EditChange `json:"changes,omitempty"` Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` diff --git a/github/github-accessors.go b/github/github-accessors.go index 6dbe7453e1b..581523c46b5 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -33550,6 +33550,14 @@ func (p *PullRequestReviewEvent) GetAction() string { return *p.Action } +// GetChanges returns the Changes field. +func (p *PullRequestReviewEvent) GetChanges() *EditChange { + if p == nil { + return nil + } + return p.Changes +} + // GetInstallation returns the Installation field. func (p *PullRequestReviewEvent) GetInstallation() *Installation { if p == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index c0eb4b2f8de..f41a7c8c751 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -42035,6 +42035,14 @@ func TestPullRequestReviewEvent_GetAction(tt *testing.T) { p.GetAction() } +func TestPullRequestReviewEvent_GetChanges(tt *testing.T) { + tt.Parallel() + p := &PullRequestReviewEvent{} + p.GetChanges() + p = nil + p.GetChanges() +} + func TestPullRequestReviewEvent_GetInstallation(tt *testing.T) { tt.Parallel() p := &PullRequestReviewEvent{}