Skip to content

Commit d3c6514

Browse files
authored
Add missing fields to Timeline (#2197)
1 parent 0511421 commit d3c6514

File tree

3 files changed

+186
-1
lines changed

3 files changed

+186
-1
lines changed

github/github-accessors.go

Lines changed: 80 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/github-accessors_test.go

Lines changed: 82 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/issues_timeline.go

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
// Timeline represents an event that occurred around an Issue or Pull Request.
1616
//
1717
// It is similar to an IssueEvent but may contain more information.
18-
// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/timeline/
18+
// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/events/issue-event-types
1919
type Timeline struct {
2020
ID *int64 `json:"id,omitempty"`
2121
URL *string `json:"url,omitempty"`
@@ -24,6 +24,18 @@ type Timeline struct {
2424
// The User object that generated the event.
2525
Actor *User `json:"actor,omitempty"`
2626

27+
// The person who commented on the issue.
28+
User *User `json:"user,omitempty"`
29+
30+
// The person who authored the commit.
31+
Author *CommitAuthor `json:"author,omitempty"`
32+
// The person who committed the commit on behalf of the author.
33+
Committer *CommitAuthor `json:"committer,omitempty"`
34+
// The SHA of the commit in the pull request.
35+
SHA *string `json:"sha,omitempty"`
36+
// The commit message.
37+
Message *string `json:"message,omitempty"`
38+
2739
// Event identifies the actual type of Event that occurred. Possible values
2840
// are:
2941
//
@@ -111,6 +123,8 @@ type Timeline struct {
111123
// The User object which was assigned to (or unassigned from) this Issue or
112124
// Pull Request. Only provided for 'assigned' and 'unassigned' events.
113125
Assignee *User `json:"assignee,omitempty"`
126+
Assigner *User `json:"assigner,omitempty"`
127+
114128
// The Milestone object including a 'title' attribute.
115129
// Only provided for 'milestoned' and 'demilestoned' events.
116130
Milestone *Milestone `json:"milestone,omitempty"`
@@ -125,6 +139,15 @@ type Timeline struct {
125139
// 'changes_requested' or 'approved'.
126140
// Only provided for 'reviewed' events.
127141
State *string `json:"state,omitempty"`
142+
143+
// The person requested to review the pull request.
144+
Reviewer *User `json:"requested_reviewer,omitempty"`
145+
// The person who requested a review.
146+
Requester *User `json:"review_requester,omitempty"`
147+
148+
// The review summary text.
149+
Body *string `json:"body,omitempty"`
150+
SubmittedAt *time.Time `json:"submitted_at,omitempty"`
128151
}
129152

130153
// Source represents a reference's source.

0 commit comments

Comments
 (0)