Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 37 additions & 10 deletions github/event_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,12 @@ type DiscussionCommentEvent struct {

// CommentDiscussion represents a comment in a GitHub DiscussionCommentEvent.
type CommentDiscussion struct {
// AuthorAssociation is the comment author's relationship to the repository.
// Possible values are "COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MEMBER", "OWNER", or "NONE".
//
// Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025.
// Use the Discussions REST API endpoint to retrieve this information.
// See: https://docs.github.com/rest/discussions/comments#get-a-discussion-comment
AuthorAssociation *string `json:"author_association,omitempty"`
Body *string `json:"body,omitempty"`
ChildCommentCount *int `json:"child_comment_count,omitempty"`
Expand Down Expand Up @@ -403,9 +409,15 @@ type Discussion struct {
Comments *int `json:"comments,omitempty"`
CreatedAt *Timestamp `json:"created_at,omitempty"`
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
AuthorAssociation *string `json:"author_association,omitempty"`
ActiveLockReason *string `json:"active_lock_reason,omitempty"`
Body *string `json:"body,omitempty"`
// AuthorAssociation is the discussion author's relationship to the repository.
// Possible values are "COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MEMBER", "OWNER", or "NONE".
//
// Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025.
// Use the Discussions REST API endpoint to retrieve this information.
// See: https://docs.github.com/rest/discussions/discussions#get-a-discussion
AuthorAssociation *string `json:"author_association,omitempty"`
ActiveLockReason *string `json:"active_lock_reason,omitempty"`
Body *string `json:"body,omitempty"`
}

// DiscussionCategory represents a discussion category in a GitHub DiscussionEvent.
Expand Down Expand Up @@ -1354,13 +1366,28 @@ type PullRequestTargetEvent struct {
//
// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#push
type PushEvent struct {
PushID *int64 `json:"push_id,omitempty"`
Head *string `json:"head,omitempty"`
Ref *string `json:"ref,omitempty"`
Size *int `json:"size,omitempty"`
Commits []*HeadCommit `json:"commits,omitempty"`
Before *string `json:"before,omitempty"`
DistinctSize *int `json:"distinct_size,omitempty"`
PushID *int64 `json:"push_id,omitempty"`
Head *string `json:"head,omitempty"`
Ref *string `json:"ref,omitempty"`
// Size is the number of commits in the push.
//
// Deprecated: GitHub will remove commit counts from Events API payloads on October 7, 2025.
// Use the Commits REST API endpoint to get commit information.
// See: https://docs.github.com/rest/commits/commits#list-commits
Size *int `json:"size,omitempty"`
// Commits is the list of commits in the push event.
//
// Deprecated: GitHub will remove commit summaries from Events API payloads on October 7, 2025.
// Use the Commits REST API endpoint to get detailed commit information.
// See: https://docs.github.com/rest/commits/commits#list-commits
Commits []*HeadCommit `json:"commits,omitempty"`
Before *string `json:"before,omitempty"`
// DistinctSize is the number of distinct commits in the push.
//
// Deprecated: GitHub will remove commit counts from Events API payloads on October 7, 2025.
// Use the Compare REST API endpoint to get detailed comparison information.
// See: https://docs.github.com/rest/commits/commits#compare-two-commits
DistinctSize *int `json:"distinct_size,omitempty"`

// The following fields are only populated by Webhook events.
Action *string `json:"action,omitempty"`
Expand Down
14 changes: 10 additions & 4 deletions github/issues.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,16 @@ type Issue struct {
Number *int `json:"number,omitempty"`
State *string `json:"state,omitempty"`
// StateReason can be one of: "completed", "not_planned", "reopened".
StateReason *string `json:"state_reason,omitempty"`
Locked *bool `json:"locked,omitempty"`
Title *string `json:"title,omitempty"`
Body *string `json:"body,omitempty"`
StateReason *string `json:"state_reason,omitempty"`
Locked *bool `json:"locked,omitempty"`
Title *string `json:"title,omitempty"`
Body *string `json:"body,omitempty"`
// AuthorAssociation is the issue author's relationship to the repository.
// Possible values are "COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MEMBER", "OWNER", or "NONE".
//
// Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025.
// Use the Issues REST API endpoint to retrieve this information.
// See: https://docs.github.com/rest/issues/issues#get-an-issue
AuthorAssociation *string `json:"author_association,omitempty"`
User *User `json:"user,omitempty"`
Labels []*Label `json:"labels,omitempty"`
Expand Down
4 changes: 4 additions & 0 deletions github/issues_comments.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ type IssueComment struct {
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
// AuthorAssociation is the comment author's relationship to the issue's repository.
// Possible values are "COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MEMBER", "OWNER", or "NONE".
//
// Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025.
// Use the Issue Comments REST API endpoint to retrieve this information.
// See: https://docs.github.com/rest/issues/comments#get-an-issue-comment
AuthorAssociation *string `json:"author_association,omitempty"`
URL *string `json:"url,omitempty"`
HTMLURL *string `json:"html_url,omitempty"`
Expand Down
58 changes: 32 additions & 26 deletions github/pulls.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,38 @@ type PullRequestAutoMerge struct {

// PullRequest represents a GitHub pull request on a repository.
type PullRequest struct {
ID *int64 `json:"id,omitempty"`
Number *int `json:"number,omitempty"`
State *string `json:"state,omitempty"`
Locked *bool `json:"locked,omitempty"`
Title *string `json:"title,omitempty"`
Body *string `json:"body,omitempty"`
CreatedAt *Timestamp `json:"created_at,omitempty"`
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
ClosedAt *Timestamp `json:"closed_at,omitempty"`
MergedAt *Timestamp `json:"merged_at,omitempty"`
Labels []*Label `json:"labels,omitempty"`
User *User `json:"user,omitempty"`
Draft *bool `json:"draft,omitempty"`
URL *string `json:"url,omitempty"`
HTMLURL *string `json:"html_url,omitempty"`
IssueURL *string `json:"issue_url,omitempty"`
StatusesURL *string `json:"statuses_url,omitempty"`
DiffURL *string `json:"diff_url,omitempty"`
PatchURL *string `json:"patch_url,omitempty"`
CommitsURL *string `json:"commits_url,omitempty"`
CommentsURL *string `json:"comments_url,omitempty"`
ReviewCommentsURL *string `json:"review_comments_url,omitempty"`
ReviewCommentURL *string `json:"review_comment_url,omitempty"`
Assignee *User `json:"assignee,omitempty"`
Assignees []*User `json:"assignees,omitempty"`
Milestone *Milestone `json:"milestone,omitempty"`
ID *int64 `json:"id,omitempty"`
Number *int `json:"number,omitempty"`
State *string `json:"state,omitempty"`
Locked *bool `json:"locked,omitempty"`
Title *string `json:"title,omitempty"`
Body *string `json:"body,omitempty"`
CreatedAt *Timestamp `json:"created_at,omitempty"`
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
ClosedAt *Timestamp `json:"closed_at,omitempty"`
MergedAt *Timestamp `json:"merged_at,omitempty"`
Labels []*Label `json:"labels,omitempty"`
User *User `json:"user,omitempty"`
Draft *bool `json:"draft,omitempty"`
URL *string `json:"url,omitempty"`
HTMLURL *string `json:"html_url,omitempty"`
IssueURL *string `json:"issue_url,omitempty"`
StatusesURL *string `json:"statuses_url,omitempty"`
DiffURL *string `json:"diff_url,omitempty"`
PatchURL *string `json:"patch_url,omitempty"`
CommitsURL *string `json:"commits_url,omitempty"`
CommentsURL *string `json:"comments_url,omitempty"`
ReviewCommentsURL *string `json:"review_comments_url,omitempty"`
ReviewCommentURL *string `json:"review_comment_url,omitempty"`
Assignee *User `json:"assignee,omitempty"`
Assignees []*User `json:"assignees,omitempty"`
Milestone *Milestone `json:"milestone,omitempty"`
// AuthorAssociation is the pull request author's relationship to the repository.
// Possible values are "COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MEMBER", "OWNER", or "NONE".
//
// Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025.
// Use the Pull Requests REST API endpoint to retrieve this information.
// See: https://docs.github.com/rest/pulls/pulls#get-a-pull-request
AuthorAssociation *string `json:"author_association,omitempty"`
NodeID *string `json:"node_id,omitempty"`
RequestedReviewers []*User `json:"requested_reviewers,omitempty"`
Expand Down
4 changes: 4 additions & 0 deletions github/pulls_comments.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ type PullRequestComment struct {
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
// AuthorAssociation is the comment author's relationship to the pull request's repository.
// Possible values are "COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MEMBER", "OWNER", or "NONE".
//
// Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025.
// Use the Pull Request Comments REST API endpoint to retrieve this information.
// See: https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request
AuthorAssociation *string `json:"author_association,omitempty"`
URL *string `json:"url,omitempty"`
HTMLURL *string `json:"html_url,omitempty"`
Expand Down
6 changes: 5 additions & 1 deletion github/pulls_reviews.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ type PullRequestReview struct {
HTMLURL *string `json:"html_url,omitempty"`
PullRequestURL *string `json:"pull_request_url,omitempty"`
State *string `json:"state,omitempty"`
// AuthorAssociation is the comment author's relationship to the issue's repository.
// AuthorAssociation is the review author's relationship to the repository.
// Possible values are "COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MEMBER", "OWNER", or "NONE".
//
// Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025.
// Use the Pull Request Reviews REST API endpoint to retrieve this information.
// See: https://docs.github.com/rest/pulls/reviews#get-a-review-for-a-pull-request
AuthorAssociation *string `json:"author_association,omitempty"`
}

Expand Down
Loading