@@ -180,6 +180,59 @@ type DeploymentStatusEvent struct {
180
180
Installation * Installation `json:"installation,omitempty"`
181
181
}
182
182
183
+ // DiscussionEvent represents a webhook event for a discussion.
184
+ // The Webhook event name is "discussion".
185
+ //
186
+ // GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#discussion
187
+ type DiscussionEvent struct {
188
+ // Action is the action that was performed. Possible values are:
189
+ // created, edited, deleted, pinned, unpinned, locked, unlocked,
190
+ // transferred, category_changed, answered, or unanswered.
191
+ Action * string `json:"action,omitempty"`
192
+ Discussion * Discussion `json:"discussion,omitempty"`
193
+ Repo * Repository `json:"repository,omitempty"`
194
+ Org * Organization `json:"organization,omitempty"`
195
+ Sender * User `json:"sender,omitempty"`
196
+ Installation * Installation `json:"installation,omitempty"`
197
+ }
198
+
199
+ // Discussion represents a discussion in a GitHub DiscussionEvent.
200
+ type Discussion struct {
201
+ RepositoryURL * string `json:"repository_url,omitempty"`
202
+ DiscussionCategory * DiscussionCategory `json:"category,omitempty"`
203
+ AnswerHTMLURL * string `json:"answer_html_url,omitempty"`
204
+ AnswerChosenAt * Timestamp `json:"answer_chosen_at,omitempty"`
205
+ AnswerChosenBy * string `json:"answer_chosen_by,omitempty"`
206
+ HTMLURL * string `json:"html_url,omitempty"`
207
+ ID * int64 `json:"id,omitempty"`
208
+ NodeID * string `json:"node_id,omitempty"`
209
+ Number * int `json:"number,omitempty"`
210
+ Title * string `json:"title,omitempty"`
211
+ User * User `json:"user,omitempty"`
212
+ State * string `json:"state,omitempty"`
213
+ Locked * bool `json:"locked,omitempty"`
214
+ Comments * int `json:"comments,omitempty"`
215
+ CreatedAt * Timestamp `json:"created_at,omitempty"`
216
+ UpdatedAt * Timestamp `json:"updated_at,omitempty"`
217
+ AuthorAssociation * string `json:"author_association,omitempty"`
218
+ ActiveLockReason * string `json:"active_lock_reason,omitempty"`
219
+ Body * string `json:"body,omitempty"`
220
+ }
221
+
222
+ // DiscussionCategory represents a discussion category in a GitHub DiscussionEvent.
223
+ type DiscussionCategory struct {
224
+ ID * int64 `json:"id,omitempty"`
225
+ NodeID * string `json:"node_id,omitempty"`
226
+ RepositoryID * int64 `json:"repository_id,omitempty"`
227
+ Emoji * string `json:"emoji,omitempty"`
228
+ Name * string `json:"name,omitempty"`
229
+ Description * string `json:"description,omitempty"`
230
+ CreatedAt * Timestamp `json:"created_at,omitempty"`
231
+ UpdatedAt * Timestamp `json:"updated_at,omitempty"`
232
+ Slug * string `json:"slug,omitempty"`
233
+ IsAnswerable * bool `json:"is_answerable,omitempty"`
234
+ }
235
+
183
236
// ForkEvent is triggered when a user forks a repository.
184
237
// The Webhook event name is "fork".
185
238
//
0 commit comments