Skip to content

Commit 2eec208

Browse files
authored
Document upcoming changes to events payload (#3667)
1 parent 84a0945 commit 2eec208

File tree

6 files changed

+92
-41
lines changed

6 files changed

+92
-41
lines changed

github/event_types.go

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,12 @@ type DiscussionCommentEvent struct {
354354

355355
// CommentDiscussion represents a comment in a GitHub DiscussionCommentEvent.
356356
type CommentDiscussion struct {
357+
// AuthorAssociation is the comment author's relationship to the repository.
358+
// Possible values are "COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MEMBER", "OWNER", or "NONE".
359+
//
360+
// Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025.
361+
// Use the Discussions REST API endpoint to retrieve this information.
362+
// See: https://docs.github.com/rest/discussions/comments#get-a-discussion-comment
357363
AuthorAssociation *string `json:"author_association,omitempty"`
358364
Body *string `json:"body,omitempty"`
359365
ChildCommentCount *int `json:"child_comment_count,omitempty"`
@@ -403,9 +409,15 @@ type Discussion struct {
403409
Comments *int `json:"comments,omitempty"`
404410
CreatedAt *Timestamp `json:"created_at,omitempty"`
405411
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
406-
AuthorAssociation *string `json:"author_association,omitempty"`
407-
ActiveLockReason *string `json:"active_lock_reason,omitempty"`
408-
Body *string `json:"body,omitempty"`
412+
// AuthorAssociation is the discussion author's relationship to the repository.
413+
// Possible values are "COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MEMBER", "OWNER", or "NONE".
414+
//
415+
// Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025.
416+
// Use the Discussions REST API endpoint to retrieve this information.
417+
// See: https://docs.github.com/rest/discussions/discussions#get-a-discussion
418+
AuthorAssociation *string `json:"author_association,omitempty"`
419+
ActiveLockReason *string `json:"active_lock_reason,omitempty"`
420+
Body *string `json:"body,omitempty"`
409421
}
410422

411423
// DiscussionCategory represents a discussion category in a GitHub DiscussionEvent.
@@ -1354,13 +1366,28 @@ type PullRequestTargetEvent struct {
13541366
//
13551367
// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#push
13561368
type PushEvent struct {
1357-
PushID *int64 `json:"push_id,omitempty"`
1358-
Head *string `json:"head,omitempty"`
1359-
Ref *string `json:"ref,omitempty"`
1360-
Size *int `json:"size,omitempty"`
1361-
Commits []*HeadCommit `json:"commits,omitempty"`
1362-
Before *string `json:"before,omitempty"`
1363-
DistinctSize *int `json:"distinct_size,omitempty"`
1369+
PushID *int64 `json:"push_id,omitempty"`
1370+
Head *string `json:"head,omitempty"`
1371+
Ref *string `json:"ref,omitempty"`
1372+
// Size is the number of commits in the push.
1373+
//
1374+
// Deprecated: GitHub will remove commit counts from Events API payloads on October 7, 2025.
1375+
// Use the Commits REST API endpoint to get commit information.
1376+
// See: https://docs.github.com/rest/commits/commits#list-commits
1377+
Size *int `json:"size,omitempty"`
1378+
// Commits is the list of commits in the push event.
1379+
//
1380+
// Deprecated: GitHub will remove commit summaries from Events API payloads on October 7, 2025.
1381+
// Use the Commits REST API endpoint to get detailed commit information.
1382+
// See: https://docs.github.com/rest/commits/commits#list-commits
1383+
Commits []*HeadCommit `json:"commits,omitempty"`
1384+
Before *string `json:"before,omitempty"`
1385+
// DistinctSize is the number of distinct commits in the push.
1386+
//
1387+
// Deprecated: GitHub will remove commit counts from Events API payloads on October 7, 2025.
1388+
// Use the Compare REST API endpoint to get detailed comparison information.
1389+
// See: https://docs.github.com/rest/commits/commits#compare-two-commits
1390+
DistinctSize *int `json:"distinct_size,omitempty"`
13641391

13651392
// The following fields are only populated by Webhook events.
13661393
Action *string `json:"action,omitempty"`

github/issues.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,16 @@ type Issue struct {
2929
Number *int `json:"number,omitempty"`
3030
State *string `json:"state,omitempty"`
3131
// StateReason can be one of: "completed", "not_planned", "reopened".
32-
StateReason *string `json:"state_reason,omitempty"`
33-
Locked *bool `json:"locked,omitempty"`
34-
Title *string `json:"title,omitempty"`
35-
Body *string `json:"body,omitempty"`
32+
StateReason *string `json:"state_reason,omitempty"`
33+
Locked *bool `json:"locked,omitempty"`
34+
Title *string `json:"title,omitempty"`
35+
Body *string `json:"body,omitempty"`
36+
// AuthorAssociation is the issue author's relationship to the repository.
37+
// Possible values are "COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MEMBER", "OWNER", or "NONE".
38+
//
39+
// Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025.
40+
// Use the Issues REST API endpoint to retrieve this information.
41+
// See: https://docs.github.com/rest/issues/issues#get-an-issue
3642
AuthorAssociation *string `json:"author_association,omitempty"`
3743
User *User `json:"user,omitempty"`
3844
Labels []*Label `json:"labels,omitempty"`

github/issues_comments.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ type IssueComment struct {
2222
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
2323
// AuthorAssociation is the comment author's relationship to the issue's repository.
2424
// Possible values are "COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MEMBER", "OWNER", or "NONE".
25+
//
26+
// Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025.
27+
// Use the Issue Comments REST API endpoint to retrieve this information.
28+
// See: https://docs.github.com/rest/issues/comments#get-an-issue-comment
2529
AuthorAssociation *string `json:"author_association,omitempty"`
2630
URL *string `json:"url,omitempty"`
2731
HTMLURL *string `json:"html_url,omitempty"`

github/pulls.go

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,32 +28,38 @@ type PullRequestAutoMerge struct {
2828

2929
// PullRequest represents a GitHub pull request on a repository.
3030
type PullRequest struct {
31-
ID *int64 `json:"id,omitempty"`
32-
Number *int `json:"number,omitempty"`
33-
State *string `json:"state,omitempty"`
34-
Locked *bool `json:"locked,omitempty"`
35-
Title *string `json:"title,omitempty"`
36-
Body *string `json:"body,omitempty"`
37-
CreatedAt *Timestamp `json:"created_at,omitempty"`
38-
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
39-
ClosedAt *Timestamp `json:"closed_at,omitempty"`
40-
MergedAt *Timestamp `json:"merged_at,omitempty"`
41-
Labels []*Label `json:"labels,omitempty"`
42-
User *User `json:"user,omitempty"`
43-
Draft *bool `json:"draft,omitempty"`
44-
URL *string `json:"url,omitempty"`
45-
HTMLURL *string `json:"html_url,omitempty"`
46-
IssueURL *string `json:"issue_url,omitempty"`
47-
StatusesURL *string `json:"statuses_url,omitempty"`
48-
DiffURL *string `json:"diff_url,omitempty"`
49-
PatchURL *string `json:"patch_url,omitempty"`
50-
CommitsURL *string `json:"commits_url,omitempty"`
51-
CommentsURL *string `json:"comments_url,omitempty"`
52-
ReviewCommentsURL *string `json:"review_comments_url,omitempty"`
53-
ReviewCommentURL *string `json:"review_comment_url,omitempty"`
54-
Assignee *User `json:"assignee,omitempty"`
55-
Assignees []*User `json:"assignees,omitempty"`
56-
Milestone *Milestone `json:"milestone,omitempty"`
31+
ID *int64 `json:"id,omitempty"`
32+
Number *int `json:"number,omitempty"`
33+
State *string `json:"state,omitempty"`
34+
Locked *bool `json:"locked,omitempty"`
35+
Title *string `json:"title,omitempty"`
36+
Body *string `json:"body,omitempty"`
37+
CreatedAt *Timestamp `json:"created_at,omitempty"`
38+
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
39+
ClosedAt *Timestamp `json:"closed_at,omitempty"`
40+
MergedAt *Timestamp `json:"merged_at,omitempty"`
41+
Labels []*Label `json:"labels,omitempty"`
42+
User *User `json:"user,omitempty"`
43+
Draft *bool `json:"draft,omitempty"`
44+
URL *string `json:"url,omitempty"`
45+
HTMLURL *string `json:"html_url,omitempty"`
46+
IssueURL *string `json:"issue_url,omitempty"`
47+
StatusesURL *string `json:"statuses_url,omitempty"`
48+
DiffURL *string `json:"diff_url,omitempty"`
49+
PatchURL *string `json:"patch_url,omitempty"`
50+
CommitsURL *string `json:"commits_url,omitempty"`
51+
CommentsURL *string `json:"comments_url,omitempty"`
52+
ReviewCommentsURL *string `json:"review_comments_url,omitempty"`
53+
ReviewCommentURL *string `json:"review_comment_url,omitempty"`
54+
Assignee *User `json:"assignee,omitempty"`
55+
Assignees []*User `json:"assignees,omitempty"`
56+
Milestone *Milestone `json:"milestone,omitempty"`
57+
// AuthorAssociation is the pull request author's relationship to the repository.
58+
// Possible values are "COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MEMBER", "OWNER", or "NONE".
59+
//
60+
// Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025.
61+
// Use the Pull Requests REST API endpoint to retrieve this information.
62+
// See: https://docs.github.com/rest/pulls/pulls#get-a-pull-request
5763
AuthorAssociation *string `json:"author_association,omitempty"`
5864
NodeID *string `json:"node_id,omitempty"`
5965
RequestedReviewers []*User `json:"requested_reviewers,omitempty"`

github/pulls_comments.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ type PullRequestComment struct {
3737
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
3838
// AuthorAssociation is the comment author's relationship to the pull request's repository.
3939
// Possible values are "COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MEMBER", "OWNER", or "NONE".
40+
//
41+
// Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025.
42+
// Use the Pull Request Comments REST API endpoint to retrieve this information.
43+
// See: https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request
4044
AuthorAssociation *string `json:"author_association,omitempty"`
4145
URL *string `json:"url,omitempty"`
4246
HTMLURL *string `json:"html_url,omitempty"`

github/pulls_reviews.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,12 @@ type PullRequestReview struct {
2424
HTMLURL *string `json:"html_url,omitempty"`
2525
PullRequestURL *string `json:"pull_request_url,omitempty"`
2626
State *string `json:"state,omitempty"`
27-
// AuthorAssociation is the comment author's relationship to the issue's repository.
27+
// AuthorAssociation is the review author's relationship to the repository.
2828
// Possible values are "COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MEMBER", "OWNER", or "NONE".
29+
//
30+
// Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025.
31+
// Use the Pull Request Reviews REST API endpoint to retrieve this information.
32+
// See: https://docs.github.com/rest/pulls/reviews#get-a-review-for-a-pull-request
2933
AuthorAssociation *string `json:"author_association,omitempty"`
3034
}
3135

0 commit comments

Comments
 (0)