github.com/google/go-github/v74@v74.0.0/github/event_types.go (about) 1 // Copyright 2016 The go-github AUTHORS. All rights reserved. 2 // 3 // Use of this source code is governed by a BSD-style 4 // license that can be found in the LICENSE file. 5 6 // These event types are shared between the Events API and used as Webhook payloads. 7 8 package github 9 10 import "encoding/json" 11 12 // RequestedAction is included in a CheckRunEvent when a user has invoked an action, 13 // i.e. when the CheckRunEvent's Action field is "requested_action". 14 type RequestedAction struct { 15 Identifier string `json:"identifier"` // The integrator reference of the action requested by the user. 16 } 17 18 // BranchProtectionRuleEvent triggered when a check suite is "created", "edited", or "deleted". 19 // The Webhook event name is "branch_protection_rule". 20 // 21 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#branch_protection_rule 22 type BranchProtectionRuleEvent struct { 23 Action *string `json:"action,omitempty"` 24 Rule *BranchProtectionRule `json:"rule,omitempty"` 25 Changes *ProtectionChanges `json:"changes,omitempty"` 26 Repo *Repository `json:"repository,omitempty"` 27 Org *Organization `json:"organization,omitempty"` 28 Sender *User `json:"sender,omitempty"` 29 Installation *Installation `json:"installation,omitempty"` 30 } 31 32 // BranchProtectionConfigurationEvent is triggered when there is a change to branch protection configurations for a repository. 33 // The Webhook event name is "branch_protection_configuration". 34 // 35 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#branch_protection_configuration 36 type BranchProtectionConfigurationEvent struct { 37 Action *string `json:"action,omitempty"` 38 Repo *Repository `json:"repository,omitempty"` 39 Org *Organization `json:"organization,omitempty"` 40 Enterprise *Enterprise `json:"enterprise,omitempty"` 41 Sender *User `json:"sender,omitempty"` 42 Installation *Installation `json:"installation,omitempty"` 43 } 44 45 // CheckRunEvent is triggered when a check run is "created", "completed", or "rerequested". 46 // The Webhook event name is "check_run". 47 // 48 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#check_run 49 type CheckRunEvent struct { 50 CheckRun *CheckRun `json:"check_run,omitempty"` 51 // The action performed. Possible values are: "created", "completed", "rerequested" or "requested_action". 52 Action *string `json:"action,omitempty"` 53 54 // The following fields are only populated by Webhook events. 55 Repo *Repository `json:"repository,omitempty"` 56 Org *Organization `json:"organization,omitempty"` 57 Sender *User `json:"sender,omitempty"` 58 Installation *Installation `json:"installation,omitempty"` 59 60 // The action requested by the user. Populated when the Action is "requested_action". 61 RequestedAction *RequestedAction `json:"requested_action,omitempty"` // 62 } 63 64 // CheckSuiteEvent is triggered when a check suite is "completed", "requested", or "rerequested". 65 // The Webhook event name is "check_suite". 66 // 67 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#check_suite 68 type CheckSuiteEvent struct { 69 CheckSuite *CheckSuite `json:"check_suite,omitempty"` 70 // The action performed. Possible values are: "completed", "requested" or "rerequested". 71 Action *string `json:"action,omitempty"` 72 73 // The following fields are only populated by Webhook events. 74 Repo *Repository `json:"repository,omitempty"` 75 Org *Organization `json:"organization,omitempty"` 76 Sender *User `json:"sender,omitempty"` 77 Installation *Installation `json:"installation,omitempty"` 78 } 79 80 // CommitCommentEvent is triggered when a commit comment is created. 81 // The Webhook event name is "commit_comment". 82 // 83 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#commit_comment 84 type CommitCommentEvent struct { 85 Comment *RepositoryComment `json:"comment,omitempty"` 86 87 // The following fields are only populated by Webhook events. 88 Action *string `json:"action,omitempty"` 89 Repo *Repository `json:"repository,omitempty"` 90 Sender *User `json:"sender,omitempty"` 91 Installation *Installation `json:"installation,omitempty"` 92 93 // The following field is only present when the webhook is triggered on 94 // a repository belonging to an organization. 95 Org *Organization `json:"organization,omitempty"` 96 } 97 98 // ContentReferenceEvent is triggered when the body or comment of an issue or 99 // pull request includes a URL that matches a configured content reference 100 // domain. 101 // The Webhook event name is "content_reference". 102 // 103 // GitHub API docs: https://developer.github.com/webhooks/event-payloads/#content_reference 104 type ContentReferenceEvent struct { 105 Action *string `json:"action,omitempty"` 106 ContentReference *ContentReference `json:"content_reference,omitempty"` 107 Repo *Repository `json:"repository,omitempty"` 108 Sender *User `json:"sender,omitempty"` 109 Installation *Installation `json:"installation,omitempty"` 110 } 111 112 // CreateEvent represents a created repository, branch, or tag. 113 // The Webhook event name is "create". 114 // 115 // Note: webhooks will not receive this event for created repositories. 116 // Additionally, webhooks will not receive this event for tags if more 117 // than three tags are pushed at once. 118 // 119 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/github-event-types#createevent 120 type CreateEvent struct { 121 Ref *string `json:"ref,omitempty"` 122 // RefType is the object that was created. Possible values are: "repository", "branch", "tag". 123 RefType *string `json:"ref_type,omitempty"` 124 MasterBranch *string `json:"master_branch,omitempty"` 125 Description *string `json:"description,omitempty"` 126 PusherType *string `json:"pusher_type,omitempty"` 127 128 // The following fields are only populated by Webhook events. 129 Repo *Repository `json:"repository,omitempty"` 130 Org *Organization `json:"organization,omitempty"` 131 Sender *User `json:"sender,omitempty"` 132 Installation *Installation `json:"installation,omitempty"` 133 } 134 135 // CustomPropertyEvent represents a created, deleted or updated custom property. 136 // The Webhook event name is "custom_property". 137 // 138 // Note: this is related to custom property configuration at the enterprise or organization level. 139 // See CustomPropertyValuesEvent for activity related to custom property values for a repository. 140 // 141 // GitHub API docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#custom_property 142 type CustomPropertyEvent struct { 143 // Action possible values are: "created", "deleted", "updated". 144 Action *string `json:"action,omitempty"` 145 Definition *CustomProperty `json:"definition,omitempty"` 146 147 // The following fields are only populated by Webhook events. 148 Enterprise *Enterprise `json:"enterprise,omitempty"` 149 Installation *Installation `json:"installation,omitempty"` 150 Org *Organization `json:"organization,omitempty"` 151 Sender *User `json:"sender,omitempty"` 152 } 153 154 // CustomPropertyValuesEvent represents an update to a custom property. 155 // The Webhook event name is "custom_property_values". 156 // 157 // GitHub API docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#custom_property_values 158 type CustomPropertyValuesEvent struct { 159 // Action possible values are: "updated". 160 Action *string `json:"action,omitempty"` 161 NewPropertyValues []*CustomPropertyValue `json:"new_property_values,omitempty"` 162 OldPropertyValues []*CustomPropertyValue `json:"old_property_values,omitempty"` 163 164 // The following fields are only populated by Webhook events. 165 Enterprise *Enterprise `json:"enterprise,omitempty"` 166 Installation *Installation `json:"installation,omitempty"` 167 Repo *Repository `json:"repository,omitempty"` 168 Org *Organization `json:"organization,omitempty"` 169 Sender *User `json:"sender,omitempty"` 170 } 171 172 // DeleteEvent represents a deleted branch or tag. 173 // The Webhook event name is "delete". 174 // 175 // Note: webhooks will not receive this event for tags if more than three tags 176 // are deleted at once. 177 // 178 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/github-event-types#deleteevent 179 type DeleteEvent struct { 180 Ref *string `json:"ref,omitempty"` 181 // RefType is the object that was deleted. Possible values are: "branch", "tag". 182 RefType *string `json:"ref_type,omitempty"` 183 184 // The following fields are only populated by Webhook events. 185 PusherType *string `json:"pusher_type,omitempty"` 186 Repo *Repository `json:"repository,omitempty"` 187 Sender *User `json:"sender,omitempty"` 188 Installation *Installation `json:"installation,omitempty"` 189 190 // The following field is only present when the webhook is triggered on 191 // a repository belonging to an organization. 192 Org *Organization `json:"organization,omitempty"` 193 } 194 195 // DependabotAlertEvent is triggered when there is activity relating to Dependabot alerts. 196 // The Webhook event name is "dependabot_alert". 197 // 198 // GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#dependabot_alert 199 type DependabotAlertEvent struct { 200 Action *string `json:"action,omitempty"` 201 Alert *DependabotAlert `json:"alert,omitempty"` 202 203 // The following fields are only populated by Webhook events. 204 Installation *Installation `json:"installation,omitempty"` 205 Enterprise *Enterprise `json:"enterprise,omitempty"` 206 Repo *Repository `json:"repository,omitempty"` 207 Sender *User `json:"sender,omitempty"` 208 209 // The following field is only present when the webhook is triggered on 210 // a repository belonging to an organization. 211 Organization *Organization `json:"organization,omitempty"` 212 } 213 214 // DeployKeyEvent is triggered when a deploy key is added or removed from a repository. 215 // The Webhook event name is "deploy_key". 216 // 217 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#deploy_key 218 type DeployKeyEvent struct { 219 // Action is the action that was performed. Possible values are: 220 // "created" or "deleted". 221 Action *string `json:"action,omitempty"` 222 223 // The deploy key resource. 224 Key *Key `json:"key,omitempty"` 225 226 // The Repository where the event occurred 227 Repo *Repository `json:"repository,omitempty"` 228 229 // The following field is only present when the webhook is triggered on 230 // a repository belonging to an organization. 231 Organization *Organization `json:"organization,omitempty"` 232 233 // The following fields are only populated by Webhook events. 234 Sender *User `json:"sender,omitempty"` 235 Installation *Installation `json:"installation,omitempty"` 236 } 237 238 // DeploymentEvent represents a deployment. 239 // The Webhook event name is "deployment". 240 // 241 // Events of this type are not visible in timelines, they are only used to trigger hooks. 242 // 243 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#deployment 244 type DeploymentEvent struct { 245 Deployment *Deployment `json:"deployment,omitempty"` 246 Repo *Repository `json:"repository,omitempty"` 247 Workflow *Workflow `json:"workflow,omitempty"` 248 WorkflowRun *WorkflowRun `json:"workflow_run,omitempty"` 249 250 // The following fields are only populated by Webhook events. 251 Sender *User `json:"sender,omitempty"` 252 Installation *Installation `json:"installation,omitempty"` 253 254 // The following field is only present when the webhook is triggered on 255 // a repository belonging to an organization. 256 Org *Organization `json:"organization,omitempty"` 257 } 258 259 // DeploymentProtectionRuleEvent represents a deployment protection rule event. 260 // The Webhook event name is "deployment_protection_rule". 261 // 262 // GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#deployment_protection_rule 263 type DeploymentProtectionRuleEvent struct { 264 Action *string `json:"action,omitempty"` 265 Environment *string `json:"environment,omitempty"` 266 Event *string `json:"event,omitempty"` 267 268 // The URL Github provides for a third-party to use in order to pass/fail a deployment gate 269 DeploymentCallbackURL *string `json:"deployment_callback_url,omitempty"` 270 Deployment *Deployment `json:"deployment,omitempty"` 271 Repo *Repository `json:"repository,omitempty"` 272 Organization *Organization `json:"organization,omitempty"` 273 PullRequests []*PullRequest `json:"pull_requests,omitempty"` 274 Sender *User `json:"sender,omitempty"` 275 Installation *Installation `json:"installation,omitempty"` 276 } 277 278 // DeploymentReviewEvent represents a deployment review event. 279 // The Webhook event name is "deployment_review". 280 // 281 // GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads?#deployment_review 282 type DeploymentReviewEvent struct { 283 // The action performed. Possible values are: "requested", "approved", or "rejected". 284 Action *string `json:"action,omitempty"` 285 286 // The following will be populated only if requested. 287 Requester *User `json:"requester,omitempty"` 288 Environment *string `json:"environment,omitempty"` 289 290 // The following will be populated only if approved or rejected. 291 Approver *User `json:"approver,omitempty"` 292 Comment *string `json:"comment,omitempty"` 293 WorkflowJobRuns []*WorkflowJobRun `json:"workflow_job_runs,omitempty"` 294 295 Enterprise *Enterprise `json:"enterprise,omitempty"` 296 Installation *Installation `json:"installation,omitempty"` 297 Organization *Organization `json:"organization,omitempty"` 298 Repo *Repository `json:"repository,omitempty"` 299 Reviewers []*RequiredReviewer `json:"reviewers,omitempty"` 300 Sender *User `json:"sender,omitempty"` 301 Since *string `json:"since,omitempty"` 302 WorkflowJobRun *WorkflowJobRun `json:"workflow_job_run,omitempty"` 303 WorkflowRun *WorkflowRun `json:"workflow_run,omitempty"` 304 } 305 306 // WorkflowJobRun represents a workflow_job_run in a GitHub DeploymentReviewEvent. 307 type WorkflowJobRun struct { 308 Conclusion *string `json:"conclusion,omitempty"` 309 CreatedAt *Timestamp `json:"created_at,omitempty"` 310 Environment *string `json:"environment,omitempty"` 311 HTMLURL *string `json:"html_url,omitempty"` 312 ID *int64 `json:"id,omitempty"` 313 Name *string `json:"name,omitempty"` 314 Status *string `json:"status,omitempty"` 315 UpdatedAt *Timestamp `json:"updated_at,omitempty"` 316 } 317 318 // DeploymentStatusEvent represents a deployment status. 319 // The Webhook event name is "deployment_status". 320 // 321 // Events of this type are not visible in timelines, they are only used to trigger hooks. 322 // 323 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#deployment_status 324 type DeploymentStatusEvent struct { 325 Action *string `json:"action,omitempty"` 326 Deployment *Deployment `json:"deployment,omitempty"` 327 DeploymentStatus *DeploymentStatus `json:"deployment_status,omitempty"` 328 Repo *Repository `json:"repository,omitempty"` 329 330 // The following fields are only populated by Webhook events. 331 Sender *User `json:"sender,omitempty"` 332 Installation *Installation `json:"installation,omitempty"` 333 334 // The following field is only present when the webhook is triggered on 335 // a repository belonging to an organization. 336 Org *Organization `json:"organization,omitempty"` 337 } 338 339 // DiscussionCommentEvent represents a webhook event for a comment on discussion. 340 // The Webhook event name is "discussion_comment". 341 // 342 // GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#discussion_comment 343 type DiscussionCommentEvent struct { 344 // Action is the action that was performed on the comment. 345 // Possible values are: "created", "edited", "deleted". ** check what all can be added 346 Action *string `json:"action,omitempty"` 347 Discussion *Discussion `json:"discussion,omitempty"` 348 Comment *CommentDiscussion `json:"comment,omitempty"` 349 Repo *Repository `json:"repository,omitempty"` 350 Org *Organization `json:"organization,omitempty"` 351 Sender *User `json:"sender,omitempty"` 352 Installation *Installation `json:"installation,omitempty"` 353 } 354 355 // CommentDiscussion represents a comment in a GitHub DiscussionCommentEvent. 356 type CommentDiscussion struct { 357 AuthorAssociation *string `json:"author_association,omitempty"` 358 Body *string `json:"body,omitempty"` 359 ChildCommentCount *int `json:"child_comment_count,omitempty"` 360 CreatedAt *Timestamp `json:"created_at,omitempty"` 361 DiscussionID *int64 `json:"discussion_id,omitempty"` 362 HTMLURL *string `json:"html_url,omitempty"` 363 ID *int64 `json:"id,omitempty"` 364 NodeID *string `json:"node_id,omitempty"` 365 ParentID *int64 `json:"parent_id,omitempty"` 366 Reactions *Reactions `json:"reactions,omitempty"` 367 RepositoryURL *string `json:"repository_url,omitempty"` 368 UpdatedAt *Timestamp `json:"updated_at,omitempty"` 369 User *User `json:"user,omitempty"` 370 } 371 372 // DiscussionEvent represents a webhook event for a discussion. 373 // The Webhook event name is "discussion". 374 // 375 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#discussion 376 type DiscussionEvent struct { 377 // Action is the action that was performed. Possible values are: 378 // created, edited, deleted, pinned, unpinned, locked, unlocked, 379 // transferred, category_changed, answered, or unanswered. 380 Action *string `json:"action,omitempty"` 381 Discussion *Discussion `json:"discussion,omitempty"` 382 Repo *Repository `json:"repository,omitempty"` 383 Org *Organization `json:"organization,omitempty"` 384 Sender *User `json:"sender,omitempty"` 385 Installation *Installation `json:"installation,omitempty"` 386 } 387 388 // Discussion represents a discussion in a GitHub DiscussionEvent. 389 type Discussion struct { 390 RepositoryURL *string `json:"repository_url,omitempty"` 391 DiscussionCategory *DiscussionCategory `json:"category,omitempty"` 392 AnswerHTMLURL *string `json:"answer_html_url,omitempty"` 393 AnswerChosenAt *Timestamp `json:"answer_chosen_at,omitempty"` 394 AnswerChosenBy *string `json:"answer_chosen_by,omitempty"` 395 HTMLURL *string `json:"html_url,omitempty"` 396 ID *int64 `json:"id,omitempty"` 397 NodeID *string `json:"node_id,omitempty"` 398 Number *int `json:"number,omitempty"` 399 Title *string `json:"title,omitempty"` 400 User *User `json:"user,omitempty"` 401 State *string `json:"state,omitempty"` 402 Locked *bool `json:"locked,omitempty"` 403 Comments *int `json:"comments,omitempty"` 404 CreatedAt *Timestamp `json:"created_at,omitempty"` 405 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"` 409 } 410 411 // DiscussionCategory represents a discussion category in a GitHub DiscussionEvent. 412 type DiscussionCategory struct { 413 ID *int64 `json:"id,omitempty"` 414 NodeID *string `json:"node_id,omitempty"` 415 RepositoryID *int64 `json:"repository_id,omitempty"` 416 Emoji *string `json:"emoji,omitempty"` 417 Name *string `json:"name,omitempty"` 418 Description *string `json:"description,omitempty"` 419 CreatedAt *Timestamp `json:"created_at,omitempty"` 420 UpdatedAt *Timestamp `json:"updated_at,omitempty"` 421 Slug *string `json:"slug,omitempty"` 422 IsAnswerable *bool `json:"is_answerable,omitempty"` 423 } 424 425 // ForkEvent is triggered when a user forks a repository. 426 // The Webhook event name is "fork". 427 // 428 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#fork 429 type ForkEvent struct { 430 // Forkee is the created repository. 431 Forkee *Repository `json:"forkee,omitempty"` 432 433 // The following fields are only populated by Webhook events. 434 Repo *Repository `json:"repository,omitempty"` 435 Sender *User `json:"sender,omitempty"` 436 Installation *Installation `json:"installation,omitempty"` 437 } 438 439 // GitHubAppAuthorizationEvent is triggered when a user's authorization for a 440 // GitHub Application is revoked. 441 // 442 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#github_app_authorization 443 type GitHubAppAuthorizationEvent struct { 444 // The action performed. Possible value is: "revoked". 445 Action *string `json:"action,omitempty"` 446 447 // The following fields are only populated by Webhook events. 448 Sender *User `json:"sender,omitempty"` 449 Installation *Installation `json:"installation,omitempty"` 450 } 451 452 // Page represents a single Wiki page. 453 type Page struct { 454 PageName *string `json:"page_name,omitempty"` 455 Title *string `json:"title,omitempty"` 456 Summary *string `json:"summary,omitempty"` 457 Action *string `json:"action,omitempty"` 458 SHA *string `json:"sha,omitempty"` 459 HTMLURL *string `json:"html_url,omitempty"` 460 } 461 462 // GollumEvent is triggered when a Wiki page is created or updated. 463 // The Webhook event name is "gollum". 464 // 465 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#gollum 466 type GollumEvent struct { 467 Pages []*Page `json:"pages,omitempty"` 468 469 // The following fields are only populated by Webhook events. 470 Repo *Repository `json:"repository,omitempty"` 471 Sender *User `json:"sender,omitempty"` 472 Installation *Installation `json:"installation,omitempty"` 473 474 // The following field is only present when the webhook is triggered on 475 // a repository belonging to an organization. 476 Org *Organization `json:"organization,omitempty"` 477 } 478 479 // EditChange represents the changes when an issue, pull request, comment, 480 // or repository has been edited. 481 type EditChange struct { 482 Title *EditTitle `json:"title,omitempty"` 483 Body *EditBody `json:"body,omitempty"` 484 Base *EditBase `json:"base,omitempty"` 485 Repo *EditRepo `json:"repository,omitempty"` 486 Owner *EditOwner `json:"owner,omitempty"` 487 DefaultBranch *EditDefaultBranch `json:"default_branch,omitempty"` 488 Topics *EditTopics `json:"topics,omitempty"` 489 } 490 491 // EditTitle represents a pull-request title change. 492 type EditTitle struct { 493 From *string `json:"from,omitempty"` 494 } 495 496 // EditBody represents a change of pull-request body. 497 type EditBody struct { 498 From *string `json:"from,omitempty"` 499 } 500 501 // EditBase represents the change of a pull-request base branch. 502 type EditBase struct { 503 Ref *EditRef `json:"ref,omitempty"` 504 SHA *EditSHA `json:"sha,omitempty"` 505 } 506 507 // EditRef represents a ref change of a pull-request. 508 type EditRef struct { 509 From *string `json:"from,omitempty"` 510 } 511 512 // EditRepo represents a change of repository name. 513 type EditRepo struct { 514 Name *RepoName `json:"name,omitempty"` 515 } 516 517 // EditOwner represents a change of repository ownership. 518 type EditOwner struct { 519 OwnerInfo *OwnerInfo `json:"from,omitempty"` 520 } 521 522 // OwnerInfo represents the account info of the owner of the repo (could be User or Organization but both are User structs). 523 type OwnerInfo struct { 524 User *User `json:"user,omitempty"` 525 Org *User `json:"organization,omitempty"` 526 } 527 528 // RepoName represents a change of repository name. 529 type RepoName struct { 530 From *string `json:"from,omitempty"` 531 } 532 533 // EditTopics represents a change of repository topics. 534 type EditTopics struct { 535 From []string `json:"from,omitempty"` 536 } 537 538 // EditSHA represents a sha change of a pull-request. 539 type EditSHA struct { 540 From *string `json:"from,omitempty"` 541 } 542 543 // EditDefaultBranch represents a change of repository's default branch name. 544 type EditDefaultBranch struct { 545 From *string `json:"from,omitempty"` 546 } 547 548 // ProjectChange represents the changes when a project has been edited. 549 type ProjectChange struct { 550 Name *ProjectName `json:"name,omitempty"` 551 Body *ProjectBody `json:"body,omitempty"` 552 } 553 554 // ProjectName represents a project name change. 555 type ProjectName struct { 556 From *string `json:"from,omitempty"` 557 } 558 559 // ProjectBody represents a project body change. 560 type ProjectBody struct { 561 From *string `json:"from,omitempty"` 562 } 563 564 // ProjectCardChange represents the changes when a project card has been edited. 565 type ProjectCardChange struct { 566 Note *ProjectCardNote `json:"note,omitempty"` 567 } 568 569 // ProjectCardNote represents a change of a note of a project card. 570 type ProjectCardNote struct { 571 From *string `json:"from,omitempty"` 572 } 573 574 // ProjectColumnChange represents the changes when a project column has been edited. 575 type ProjectColumnChange struct { 576 Name *ProjectColumnName `json:"name,omitempty"` 577 } 578 579 // ProjectColumnName represents a project column name change. 580 type ProjectColumnName struct { 581 From *string `json:"from,omitempty"` 582 } 583 584 // TeamChange represents the changes when a team has been edited. 585 type TeamChange struct { 586 Description *TeamDescription `json:"description,omitempty"` 587 Name *TeamName `json:"name,omitempty"` 588 Privacy *TeamPrivacy `json:"privacy,omitempty"` 589 Repository *TeamRepository `json:"repository,omitempty"` 590 } 591 592 // TeamDescription represents a team description change. 593 type TeamDescription struct { 594 From *string `json:"from,omitempty"` 595 } 596 597 // TeamName represents a team name change. 598 type TeamName struct { 599 From *string `json:"from,omitempty"` 600 } 601 602 // TeamPrivacy represents a team privacy change. 603 type TeamPrivacy struct { 604 From *string `json:"from,omitempty"` 605 } 606 607 // TeamRepository represents a team repository permission change. 608 type TeamRepository struct { 609 Permissions *TeamPermissions `json:"permissions,omitempty"` 610 } 611 612 // TeamPermissions represents a team permission change. 613 type TeamPermissions struct { 614 From *TeamPermissionsFrom `json:"from,omitempty"` 615 } 616 617 // TeamPermissionsFrom represents a team permission change. 618 type TeamPermissionsFrom struct { 619 Admin *bool `json:"admin,omitempty"` 620 Pull *bool `json:"pull,omitempty"` 621 Push *bool `json:"push,omitempty"` 622 } 623 624 // InstallationEvent is triggered when a GitHub App has been installed, uninstalled, suspend, unsuspended 625 // or new permissions have been accepted. 626 // The Webhook event name is "installation". 627 // 628 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#installation 629 type InstallationEvent struct { 630 // The action that was performed. Can be either "created", "deleted", "suspend", "unsuspend" or "new_permissions_accepted". 631 Action *string `json:"action,omitempty"` 632 Repositories []*Repository `json:"repositories,omitempty"` 633 Sender *User `json:"sender,omitempty"` 634 Installation *Installation `json:"installation,omitempty"` 635 Requester *User `json:"requester,omitempty"` 636 637 // The following field is only present when the webhook is triggered on 638 // a repository belonging to an organization. 639 Org *Organization `json:"organization,omitempty"` 640 } 641 642 // InstallationRepositoriesEvent is triggered when a repository is added or 643 // removed from an installation. The Webhook event name is "installation_repositories". 644 // 645 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#installation_repositories 646 type InstallationRepositoriesEvent struct { 647 // The action that was performed. Can be either "added" or "removed". 648 Action *string `json:"action,omitempty"` 649 RepositoriesAdded []*Repository `json:"repositories_added,omitempty"` 650 RepositoriesRemoved []*Repository `json:"repositories_removed,omitempty"` 651 RepositorySelection *string `json:"repository_selection,omitempty"` 652 Sender *User `json:"sender,omitempty"` 653 Installation *Installation `json:"installation,omitempty"` 654 655 // The following field is only present when the webhook is triggered on 656 // a repository belonging to an organization. 657 Org *Organization `json:"organization,omitempty"` 658 } 659 660 // InstallationLoginChange represents a change in login on an installation. 661 type InstallationLoginChange struct { 662 From *string `json:"from,omitempty"` 663 } 664 665 // InstallationSlugChange represents a change in slug on an installation. 666 type InstallationSlugChange struct { 667 From *string `json:"from,omitempty"` 668 } 669 670 // InstallationChanges represents a change in slug or login on an installation. 671 type InstallationChanges struct { 672 Login *InstallationLoginChange `json:"login,omitempty"` 673 Slug *InstallationSlugChange `json:"slug,omitempty"` 674 } 675 676 // InstallationTargetEvent is triggered when there is activity on an installation from a user or organization account. 677 // The Webhook event name is "installation_target". 678 // 679 // GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#installation_target 680 type InstallationTargetEvent struct { 681 Account *User `json:"account,omitempty"` 682 Action *string `json:"action,omitempty"` 683 Changes *InstallationChanges `json:"changes,omitempty"` 684 Enterprise *Enterprise `json:"enterprise,omitempty"` 685 Installation *Installation `json:"installation,omitempty"` 686 Organization *Organization `json:"organization,omitempty"` 687 Repository *Repository `json:"repository,omitempty"` 688 Sender *User `json:"sender,omitempty"` 689 TargetType *string `json:"target_type,omitempty"` 690 } 691 692 // IssueCommentEvent is triggered when an issue comment is created on an issue 693 // or pull request. 694 // The Webhook event name is "issue_comment". 695 // 696 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#issue_comment 697 type IssueCommentEvent struct { 698 // Action is the action that was performed on the comment. 699 // Possible values are: "created", "edited", "deleted". 700 Action *string `json:"action,omitempty"` 701 Issue *Issue `json:"issue,omitempty"` 702 Comment *IssueComment `json:"comment,omitempty"` 703 704 // The following fields are only populated by Webhook events. 705 Changes *EditChange `json:"changes,omitempty"` 706 Repo *Repository `json:"repository,omitempty"` 707 Sender *User `json:"sender,omitempty"` 708 Installation *Installation `json:"installation,omitempty"` 709 710 // The following field is only present when the webhook is triggered on 711 // a repository belonging to an organization. 712 Organization *Organization `json:"organization,omitempty"` 713 } 714 715 // IssuesEvent is triggered when an issue is opened, edited, deleted, transferred, 716 // pinned, unpinned, closed, reopened, assigned, unassigned, labeled, unlabeled, 717 // locked, unlocked, milestoned, or demilestoned. 718 // The Webhook event name is "issues". 719 // 720 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#issues 721 type IssuesEvent struct { 722 // Action is the action that was performed. Possible values are: "opened", 723 // "edited", "deleted", "transferred", "pinned", "unpinned", "closed", "reopened", 724 // "assigned", "unassigned", "labeled", "unlabeled", "locked", "unlocked", 725 // "milestoned", or "demilestoned". 726 Action *string `json:"action,omitempty"` 727 Issue *Issue `json:"issue,omitempty"` 728 Assignee *User `json:"assignee,omitempty"` 729 Label *Label `json:"label,omitempty"` 730 731 // The following fields are only populated by Webhook events. 732 Changes *EditChange `json:"changes,omitempty"` 733 Repo *Repository `json:"repository,omitempty"` 734 Sender *User `json:"sender,omitempty"` 735 Installation *Installation `json:"installation,omitempty"` 736 Milestone *Milestone `json:"milestone,omitempty"` 737 738 // The following field is only present when the webhook is triggered on 739 // a repository belonging to an organization. 740 Org *Organization `json:"organization,omitempty"` 741 } 742 743 // LabelEvent is triggered when a repository's label is created, edited, or deleted. 744 // The Webhook event name is "label" 745 // 746 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#label 747 type LabelEvent struct { 748 // Action is the action that was performed. Possible values are: 749 // "created", "edited", "deleted" 750 Action *string `json:"action,omitempty"` 751 Label *Label `json:"label,omitempty"` 752 Changes *EditChange `json:"changes,omitempty"` 753 754 // The following fields are only populated by Webhook events. 755 Repo *Repository `json:"repository,omitempty"` 756 Org *Organization `json:"organization,omitempty"` 757 Sender *User `json:"sender,omitempty"` 758 Installation *Installation `json:"installation,omitempty"` 759 } 760 761 // MarketplacePurchaseEvent is triggered when a user purchases, cancels, or changes 762 // their GitHub Marketplace plan. 763 // Webhook event name "marketplace_purchase". 764 // 765 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#marketplace_purchase 766 type MarketplacePurchaseEvent struct { 767 // Action is the action that was performed. Possible values are: 768 // "purchased", "cancelled", "pending_change", "pending_change_cancelled", "changed". 769 Action *string `json:"action,omitempty"` 770 771 // The following fields are only populated by Webhook events. 772 EffectiveDate *Timestamp `json:"effective_date,omitempty"` 773 MarketplacePurchase *MarketplacePurchase `json:"marketplace_purchase,omitempty"` 774 PreviousMarketplacePurchase *MarketplacePurchase `json:"previous_marketplace_purchase,omitempty"` 775 Sender *User `json:"sender,omitempty"` 776 Installation *Installation `json:"installation,omitempty"` 777 778 // The following field is only present when the webhook is triggered on 779 // a repository belonging to an organization. 780 Org *Organization `json:"organization,omitempty"` 781 } 782 783 // MemberChangesPermission represents changes to a repository collaborator's permissions. 784 type MemberChangesPermission struct { 785 From *string `json:"from,omitempty"` 786 To *string `json:"to,omitempty"` 787 } 788 789 // MemberChangesRoleName represents changes to a repository collaborator's role. 790 type MemberChangesRoleName struct { 791 From *string `json:"from,omitempty"` 792 To *string `json:"to,omitempty"` 793 } 794 795 // MemberChanges represents changes to a repository collaborator's role or permission. 796 type MemberChanges struct { 797 Permission *MemberChangesPermission `json:"permission,omitempty"` 798 RoleName *MemberChangesRoleName `json:"role_name,omitempty"` 799 } 800 801 // MemberEvent is triggered when a user's membership as a collaborator to a repository changes. 802 // The Webhook event name is "member". 803 // 804 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#member 805 type MemberEvent struct { 806 // Action is the action that was performed. Possible values are: "added", "edited", "removed". 807 Action *string `json:"action,omitempty"` 808 Member *User `json:"member,omitempty"` 809 Changes *MemberChanges `json:"changes,omitempty"` 810 811 // The following fields are only populated by Webhook events. 812 Repo *Repository `json:"repository,omitempty"` 813 Sender *User `json:"sender,omitempty"` 814 Installation *Installation `json:"installation,omitempty"` 815 816 // The following field is only present when the webhook is triggered on 817 // a repository belonging to an organization. 818 Org *Organization `json:"organization,omitempty"` 819 } 820 821 // MembershipEvent is triggered when a user is added or removed from a team. 822 // The Webhook event name is "membership". 823 // 824 // Events of this type are not visible in timelines, they are only used to 825 // trigger organization webhooks. 826 // 827 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#membership 828 type MembershipEvent struct { 829 // Action is the action that was performed. Possible values are: "added", "removed". 830 Action *string `json:"action,omitempty"` 831 // Scope is the scope of the membership. Possible value is: "team". 832 Scope *string `json:"scope,omitempty"` 833 Member *User `json:"member,omitempty"` 834 Team *Team `json:"team,omitempty"` 835 836 // The following fields are only populated by Webhook events. 837 Org *Organization `json:"organization,omitempty"` 838 Sender *User `json:"sender,omitempty"` 839 Installation *Installation `json:"installation,omitempty"` 840 } 841 842 // MergeGroup represents the merge group in a merge queue. 843 type MergeGroup struct { 844 // The SHA of the merge group. 845 HeadSHA *string `json:"head_sha,omitempty"` 846 // The full ref of the merge group. 847 HeadRef *string `json:"head_ref,omitempty"` 848 // The SHA of the merge group's parent commit. 849 BaseSHA *string `json:"base_sha,omitempty"` 850 // The full ref of the branch the merge group will be merged into. 851 BaseRef *string `json:"base_ref,omitempty"` 852 // An expanded representation of the head_sha commit. 853 HeadCommit *Commit `json:"head_commit,omitempty"` 854 } 855 856 // MergeGroupEvent represents activity related to merge groups in a merge queue. The type of activity is specified 857 // in the action property of the payload object. 858 // 859 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#merge_group 860 type MergeGroupEvent struct { 861 // The action that was performed. Possible values are: "checks_requested", "destroyed". 862 Action *string `json:"action,omitempty"` 863 // Reason is populated when the action is "destroyed". Possible values: "merged", "invalidated", "dequeued". 864 Reason *string `json:"reason,omitempty"` 865 // The merge group. 866 MergeGroup *MergeGroup `json:"merge_group,omitempty"` 867 868 // The following fields are only populated by Webhook events. 869 Repo *Repository `json:"repository,omitempty"` 870 Org *Organization `json:"organization,omitempty"` 871 Installation *Installation `json:"installation,omitempty"` 872 Sender *User `json:"sender,omitempty"` 873 } 874 875 // MetaEvent is triggered when the webhook that this event is configured on is deleted. 876 // This event will only listen for changes to the particular hook the event is installed on. 877 // Therefore, it must be selected for each hook that you'd like to receive meta events for. 878 // The Webhook event name is "meta". 879 // 880 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#meta 881 type MetaEvent struct { 882 // Action is the action that was performed. Possible value is: "deleted". 883 Action *string `json:"action,omitempty"` 884 // The ID of the modified webhook. 885 HookID *int64 `json:"hook_id,omitempty"` 886 // The modified webhook. 887 // This will contain different keys based on the type of webhook it is: repository, 888 // organization, business, app, or GitHub Marketplace. 889 Hook *Hook `json:"hook,omitempty"` 890 891 // The following fields are only populated by Webhook events. 892 Repo *Repository `json:"repository,omitempty"` 893 Org *Organization `json:"organization,omitempty"` 894 Sender *User `json:"sender,omitempty"` 895 Installation *Installation `json:"installation,omitempty"` 896 } 897 898 // MilestoneEvent is triggered when a milestone is created, closed, opened, edited, or deleted. 899 // The Webhook event name is "milestone". 900 // 901 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#milestone 902 type MilestoneEvent struct { 903 // Action is the action that was performed. Possible values are: 904 // "created", "closed", "opened", "edited", "deleted" 905 Action *string `json:"action,omitempty"` 906 Milestone *Milestone `json:"milestone,omitempty"` 907 908 // The following fields are only populated by Webhook events. 909 Changes *EditChange `json:"changes,omitempty"` 910 Repo *Repository `json:"repository,omitempty"` 911 Sender *User `json:"sender,omitempty"` 912 Org *Organization `json:"organization,omitempty"` 913 Installation *Installation `json:"installation,omitempty"` 914 } 915 916 // OrganizationEvent is triggered when an organization is deleted and renamed, and when a user is added, 917 // removed, or invited to an organization. 918 // Events of this type are not visible in timelines. These events are only used to trigger organization hooks. 919 // Webhook event name is "organization". 920 // 921 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#organization 922 type OrganizationEvent struct { 923 // Action is the action that was performed. 924 // Possible values are: "deleted", "renamed", "member_added", "member_removed", or "member_invited". 925 Action *string `json:"action,omitempty"` 926 927 // Invitation is the invitation for the user or email if the action is "member_invited". 928 Invitation *Invitation `json:"invitation,omitempty"` 929 930 // Membership is the membership between the user and the organization. 931 // Not present when the action is "member_invited". 932 Membership *Membership `json:"membership,omitempty"` 933 934 Organization *Organization `json:"organization,omitempty"` 935 Sender *User `json:"sender,omitempty"` 936 Installation *Installation `json:"installation,omitempty"` 937 } 938 939 // OrgBlockEvent is triggered when an organization blocks or unblocks a user. 940 // The Webhook event name is "org_block". 941 // 942 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#org_block 943 type OrgBlockEvent struct { 944 // Action is the action that was performed. 945 // Can be "blocked" or "unblocked". 946 Action *string `json:"action,omitempty"` 947 BlockedUser *User `json:"blocked_user,omitempty"` 948 Organization *Organization `json:"organization,omitempty"` 949 Sender *User `json:"sender,omitempty"` 950 951 // The following fields are only populated by Webhook events. 952 Installation *Installation `json:"installation,omitempty"` 953 } 954 955 // PackageEvent represents activity related to GitHub Packages. 956 // The Webhook event name is "package". 957 // 958 // This event is triggered when a GitHub Package is published or updated. 959 // 960 // GitHub API docs: https://developer.github.com/webhooks/event-payloads/#package 961 type PackageEvent struct { 962 // Action is the action that was performed. 963 // Can be "published" or "updated". 964 Action *string `json:"action,omitempty"` 965 Package *Package `json:"package,omitempty"` 966 Repo *Repository `json:"repository,omitempty"` 967 Org *Organization `json:"organization,omitempty"` 968 Sender *User `json:"sender,omitempty"` 969 970 // The following fields are only populated by Webhook events. 971 Installation *Installation `json:"installation,omitempty"` 972 } 973 974 // PageBuildEvent represents an attempted build of a GitHub Pages site, whether 975 // successful or not. 976 // The Webhook event name is "page_build". 977 // 978 // This event is triggered on push to a GitHub Pages enabled branch (gh-pages 979 // for project pages, master for user and organization pages). 980 // 981 // Events of this type are not visible in timelines, they are only used to trigger hooks. 982 // 983 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#page_build 984 type PageBuildEvent struct { 985 Build *PagesBuild `json:"build,omitempty"` 986 987 // The following fields are only populated by Webhook events. 988 ID *int64 `json:"id,omitempty"` 989 Repo *Repository `json:"repository,omitempty"` 990 Sender *User `json:"sender,omitempty"` 991 Installation *Installation `json:"installation,omitempty"` 992 993 // The following field is only present when the webhook is triggered on 994 // a repository belonging to an organization. 995 Org *Organization `json:"organization,omitempty"` 996 } 997 998 // PersonalAccessTokenRequestEvent occurs when there is activity relating to a 999 // request for a fine-grained personal access token to access resources that 1000 // belong to a resource owner that requires approval for token access. 1001 // The webhook event name is "personal_access_token_request". 1002 // 1003 // GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#personal_access_token_request 1004 type PersonalAccessTokenRequestEvent struct { 1005 // Action is the action that was performed. Possible values are: 1006 // "approved", "cancelled", "created" or "denied" 1007 Action *string `json:"action,omitempty"` 1008 PersonalAccessTokenRequest *PersonalAccessTokenRequest `json:"personal_access_token_request,omitempty"` 1009 Org *Organization `json:"organization,omitempty"` 1010 Sender *User `json:"sender,omitempty"` 1011 Installation *Installation `json:"installation,omitempty"` 1012 } 1013 1014 // PersonalAccessTokenRequest contains the details of a PersonalAccessTokenRequestEvent. 1015 type PersonalAccessTokenRequest struct { 1016 // Unique identifier of the request for access via fine-grained personal 1017 // access token. Used as the pat_request_id parameter in the list and review 1018 // API calls. 1019 ID *int64 `json:"id,omitempty"` 1020 Owner *User `json:"owner,omitempty"` 1021 1022 // New requested permissions, categorized by type of permission. 1023 PermissionsAdded *PersonalAccessTokenPermissions `json:"permissions_added,omitempty"` 1024 1025 // Requested permissions that elevate access for a previously approved 1026 // request for access, categorized by type of permission. 1027 PermissionsUpgraded *PersonalAccessTokenPermissions `json:"permissions_upgraded,omitempty"` 1028 1029 // Permissions requested, categorized by type of permission. 1030 // This field incorporates permissions_added and permissions_upgraded. 1031 PermissionsResult *PersonalAccessTokenPermissions `json:"permissions_result,omitempty"` 1032 1033 // Type of repository selection requested. Possible values are: 1034 // "none", "all" or "subset" 1035 RepositorySelection *string `json:"repository_selection,omitempty"` 1036 1037 // The number of repositories the token is requesting access to. 1038 // This field is only populated when repository_selection is subset. 1039 RepositoryCount *int64 `json:"repository_count,omitempty"` 1040 1041 // An array of repository objects the token is requesting access to. 1042 // This field is only populated when repository_selection is subset. 1043 Repositories []*Repository `json:"repositories,omitempty"` 1044 1045 // Date and time when the request for access was created. 1046 CreatedAt *Timestamp `json:"created_at,omitempty"` 1047 1048 // Whether the associated fine-grained personal access token has expired. 1049 TokenExpired *bool `json:"token_expired,omitempty"` 1050 1051 // Date and time when the associated fine-grained personal access token expires. 1052 TokenExpiresAt *Timestamp `json:"token_expires_at,omitempty"` 1053 1054 // Date and time when the associated fine-grained personal access token was last used for authentication. 1055 TokenLastUsedAt *Timestamp `json:"token_last_used_at,omitempty"` 1056 1057 // The following field is only present when the webhook is triggered on 1058 // a repository belonging to an organization. 1059 Org *Organization `json:"organization,omitempty"` 1060 } 1061 1062 // PersonalAccessTokenPermissions represents the original or newly requested 1063 // scope of permissions for a fine-grained personal access token within a PersonalAccessTokenRequest. 1064 type PersonalAccessTokenPermissions struct { 1065 Org map[string]string `json:"organization,omitempty"` 1066 Repo map[string]string `json:"repository,omitempty"` 1067 Other map[string]string `json:"other,omitempty"` 1068 } 1069 1070 // PingEvent is triggered when a Webhook is added to GitHub. 1071 // 1072 // GitHub API docs: https://developer.github.com/webhooks/#ping-event 1073 type PingEvent struct { 1074 // Random string of GitHub zen. 1075 Zen *string `json:"zen,omitempty"` 1076 // The ID of the webhook that triggered the ping. 1077 HookID *int64 `json:"hook_id,omitempty"` 1078 // The webhook configuration. 1079 Hook *Hook `json:"hook,omitempty"` 1080 1081 // The following fields are only populated by Webhook events. 1082 Repo *Repository `json:"repository,omitempty"` 1083 Org *Organization `json:"organization,omitempty"` 1084 Sender *User `json:"sender,omitempty"` 1085 Installation *Installation `json:"installation,omitempty"` 1086 } 1087 1088 // ProjectV2Event is triggered when there is activity relating to an organization-level project. 1089 // The Webhook event name is "projects_v2". 1090 // 1091 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#projects_v2 1092 type ProjectV2Event struct { 1093 Action *string `json:"action,omitempty"` 1094 ProjectsV2 *ProjectV2 `json:"projects_v2,omitempty"` 1095 1096 // The following fields are only populated by Webhook events. 1097 Installation *Installation `json:"installation,omitempty"` 1098 Org *Organization `json:"organization,omitempty"` 1099 Sender *User `json:"sender,omitempty"` 1100 } 1101 1102 // ProjectV2 represents a v2 project. 1103 type ProjectV2 struct { 1104 ID *int64 `json:"id,omitempty"` 1105 NodeID *string `json:"node_id,omitempty"` 1106 Owner *User `json:"owner,omitempty"` 1107 Creator *User `json:"creator,omitempty"` 1108 Title *string `json:"title,omitempty"` 1109 Description *string `json:"description,omitempty"` 1110 Public *bool `json:"public,omitempty"` 1111 ClosedAt *Timestamp `json:"closed_at,omitempty"` 1112 CreatedAt *Timestamp `json:"created_at,omitempty"` 1113 UpdatedAt *Timestamp `json:"updated_at,omitempty"` 1114 DeletedAt *Timestamp `json:"deleted_at,omitempty"` 1115 Number *int `json:"number,omitempty"` 1116 ShortDescription *string `json:"short_description,omitempty"` 1117 DeletedBy *User `json:"deleted_by,omitempty"` 1118 1119 // Fields migrated from the Project (classic) struct: 1120 URL *string `json:"url,omitempty"` 1121 HTMLURL *string `json:"html_url,omitempty"` 1122 ColumnsURL *string `json:"columns_url,omitempty"` 1123 OwnerURL *string `json:"owner_url,omitempty"` 1124 Name *string `json:"name,omitempty"` 1125 Body *string `json:"body,omitempty"` 1126 State *string `json:"state,omitempty"` 1127 OrganizationPermission *string `json:"organization_permission,omitempty"` 1128 Private *bool `json:"private,omitempty"` 1129 } 1130 1131 // ProjectV2ItemEvent is triggered when there is activity relating to an item on an organization-level project. 1132 // The Webhook event name is "projects_v2_item". 1133 // 1134 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#projects_v2_item 1135 type ProjectV2ItemEvent struct { 1136 Action *string `json:"action,omitempty"` 1137 Changes *ProjectV2ItemChange `json:"changes,omitempty"` 1138 ProjectV2Item *ProjectV2Item `json:"projects_v2_item,omitempty"` 1139 1140 // The following fields are only populated by Webhook events. 1141 Installation *Installation `json:"installation,omitempty"` 1142 Org *Organization `json:"organization,omitempty"` 1143 Sender *User `json:"sender,omitempty"` 1144 } 1145 1146 // ProjectV2ItemChange represents a project v2 item change. 1147 type ProjectV2ItemChange struct { 1148 ArchivedAt *ArchivedAt `json:"archived_at,omitempty"` 1149 } 1150 1151 // ArchivedAt represents an archiving date change. 1152 type ArchivedAt struct { 1153 From *Timestamp `json:"from,omitempty"` 1154 To *Timestamp `json:"to,omitempty"` 1155 } 1156 1157 // ProjectV2Item represents an item belonging to a project. 1158 type ProjectV2Item struct { 1159 ID *int64 `json:"id,omitempty"` 1160 NodeID *string `json:"node_id,omitempty"` 1161 ProjectNodeID *string `json:"project_node_id,omitempty"` 1162 ContentNodeID *string `json:"content_node_id,omitempty"` 1163 ContentType *string `json:"content_type,omitempty"` 1164 Creator *User `json:"creator,omitempty"` 1165 CreatedAt *Timestamp `json:"created_at,omitempty"` 1166 UpdatedAt *Timestamp `json:"updated_at,omitempty"` 1167 ArchivedAt *Timestamp `json:"archived_at,omitempty"` 1168 } 1169 1170 // PublicEvent is triggered when a private repository is open sourced. 1171 // According to GitHub: "Without a doubt: the best GitHub event." 1172 // The Webhook event name is "public". 1173 // 1174 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#public 1175 type PublicEvent struct { 1176 // The following fields are only populated by Webhook events. 1177 Repo *Repository `json:"repository,omitempty"` 1178 Sender *User `json:"sender,omitempty"` 1179 Installation *Installation `json:"installation,omitempty"` 1180 1181 // The following field is only present when the webhook is triggered on 1182 // a repository belonging to an organization. 1183 Org *Organization `json:"organization,omitempty"` 1184 } 1185 1186 // PullRequestEvent is triggered when a pull request is assigned, unassigned, labeled, 1187 // unlabeled, opened, edited, closed, reopened, synchronize, ready_for_review, 1188 // locked, unlocked, a pull request review is requested, or a review request is removed. 1189 // The Webhook event name is "pull_request". 1190 // 1191 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/github-event-types#pullrequestevent 1192 type PullRequestEvent struct { 1193 // Action is the action that was performed. Possible values are: 1194 // "assigned", "unassigned", "review_requested", "review_request_removed", "labeled", "unlabeled", 1195 // "opened", "edited", "closed", "ready_for_review", "locked", "unlocked", or "reopened". 1196 // If the action is "closed" and the "merged" key is "false", the pull request was closed with unmerged commits. 1197 // If the action is "closed" and the "merged" key is "true", the pull request was merged. 1198 // While webhooks are also triggered when a pull request is synchronized, Events API timelines 1199 // don't include pull request events with the "synchronize" action. 1200 Action *string `json:"action,omitempty"` 1201 Assignee *User `json:"assignee,omitempty"` 1202 Number *int `json:"number,omitempty"` 1203 PullRequest *PullRequest `json:"pull_request,omitempty"` 1204 1205 // The following fields are only populated by Webhook events. 1206 Changes *EditChange `json:"changes,omitempty"` 1207 // RequestedReviewer is populated in "review_requested", "review_request_removed" event deliveries. 1208 // A request affecting multiple reviewers at once is split into multiple 1209 // such event deliveries, each with a single, different RequestedReviewer. 1210 RequestedReviewer *User `json:"requested_reviewer,omitempty"` 1211 // In the event that a team is requested instead of a user, "requested_team" gets sent in place of 1212 // "requested_user" with the same delivery behavior. 1213 RequestedTeam *Team `json:"requested_team,omitempty"` 1214 Repo *Repository `json:"repository,omitempty"` 1215 Sender *User `json:"sender,omitempty"` 1216 Installation *Installation `json:"installation,omitempty"` 1217 Label *Label `json:"label,omitempty"` // Populated in "labeled" event deliveries. 1218 1219 // The following field is only present when the webhook is triggered on 1220 // a repository belonging to an organization. 1221 Organization *Organization `json:"organization,omitempty"` 1222 1223 // The following fields are only populated when the Action is "synchronize". 1224 Before *string `json:"before,omitempty"` 1225 After *string `json:"after,omitempty"` 1226 1227 // The following will be populated if the event was performed by an App 1228 PerformedViaGithubApp *App `json:"performed_via_github_app,omitempty"` 1229 } 1230 1231 // PullRequestReviewEvent is triggered when a review is submitted on a pull 1232 // request. 1233 // The Webhook event name is "pull_request_review". 1234 // 1235 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review 1236 type PullRequestReviewEvent struct { 1237 // Action is always "submitted". 1238 Action *string `json:"action,omitempty"` 1239 Review *PullRequestReview `json:"review,omitempty"` 1240 PullRequest *PullRequest `json:"pull_request,omitempty"` 1241 1242 // The following fields are only populated by Webhook events. 1243 Repo *Repository `json:"repository,omitempty"` 1244 Sender *User `json:"sender,omitempty"` 1245 Installation *Installation `json:"installation,omitempty"` 1246 1247 // The following field is only present when the webhook is triggered on 1248 // a repository belonging to an organization. 1249 Organization *Organization `json:"organization,omitempty"` 1250 } 1251 1252 // PullRequestReviewCommentEvent is triggered when a comment is created on a 1253 // portion of the unified diff of a pull request. 1254 // The Webhook event name is "pull_request_review_comment". 1255 // 1256 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review_comment 1257 type PullRequestReviewCommentEvent struct { 1258 // Action is the action that was performed on the comment. 1259 // Possible values are: "created", "edited", "deleted". 1260 Action *string `json:"action,omitempty"` 1261 PullRequest *PullRequest `json:"pull_request,omitempty"` 1262 Comment *PullRequestComment `json:"comment,omitempty"` 1263 1264 // The following fields are only populated by Webhook events. 1265 Changes *EditChange `json:"changes,omitempty"` 1266 Repo *Repository `json:"repository,omitempty"` 1267 Sender *User `json:"sender,omitempty"` 1268 Installation *Installation `json:"installation,omitempty"` 1269 1270 // The following field is only present when the webhook is triggered on 1271 // a repository belonging to an organization. 1272 Org *Organization `json:"organization,omitempty"` 1273 } 1274 1275 // PullRequestReviewThreadEvent is triggered when a comment made as part of a 1276 // review of a pull request is marked resolved or unresolved. 1277 // The Webhook event name is "pull_request_review_thread". 1278 // 1279 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review_thread 1280 type PullRequestReviewThreadEvent struct { 1281 // Action is the action that was performed on the comment. 1282 // Possible values are: "resolved", "unresolved". 1283 Action *string `json:"action,omitempty"` 1284 Thread *PullRequestThread `json:"thread,omitempty"` 1285 PullRequest *PullRequest `json:"pull_request,omitempty"` 1286 1287 // The following fields are only populated by Webhook events. 1288 Repo *Repository `json:"repository,omitempty"` 1289 Sender *User `json:"sender,omitempty"` 1290 Installation *Installation `json:"installation,omitempty"` 1291 1292 // The following field is only present when the webhook is triggered on 1293 // a repository belonging to an organization. 1294 Org *Organization `json:"organization,omitempty"` 1295 } 1296 1297 // PullRequestTargetEvent is triggered when a pull request is assigned, unassigned, labeled, 1298 // unlabeled, opened, edited, closed, reopened, synchronize, ready_for_review, 1299 // locked, unlocked, a pull request review is requested, or a review request is removed. 1300 // The Webhook event name is "pull_request_target". 1301 // 1302 // GitHub API docs: https://docs.github.com/actions/events-that-trigger-workflows#pull_request_target 1303 type PullRequestTargetEvent struct { 1304 // Action is the action that was performed. Possible values are: 1305 // "assigned", "unassigned", "labeled", "unlabeled", "opened", "edited", "closed", "reopened", 1306 // "ready_for_review", "locked", "unlocked", "review_requested" or "review_request_removed". 1307 // If the action is "closed" and the "merged" key is "false", the pull request was closed with unmerged commits. 1308 // If the action is "closed" and the "merged" key is "true", the pull request was merged. 1309 // While webhooks are also triggered when a pull request is synchronized, Events API timelines 1310 // don't include pull request events with the "synchronize" action. 1311 Action *string `json:"action,omitempty"` 1312 Assignee *User `json:"assignee,omitempty"` 1313 Number *int `json:"number,omitempty"` 1314 PullRequest *PullRequest `json:"pull_request,omitempty"` 1315 1316 // The following fields are only populated by Webhook events. 1317 Changes *EditChange `json:"changes,omitempty"` 1318 // RequestedReviewer is populated in "review_requested", "review_request_removed" event deliveries. 1319 // A request affecting multiple reviewers at once is split into multiple 1320 // such event deliveries, each with a single, different RequestedReviewer. 1321 RequestedReviewer *User `json:"requested_reviewer,omitempty"` 1322 // In the event that a team is requested instead of a user, "requested_team" gets sent in place of 1323 // "requested_user" with the same delivery behavior. 1324 RequestedTeam *Team `json:"requested_team,omitempty"` 1325 Repo *Repository `json:"repository,omitempty"` 1326 Sender *User `json:"sender,omitempty"` 1327 Installation *Installation `json:"installation,omitempty"` 1328 Label *Label `json:"label,omitempty"` // Populated in "labeled" event deliveries. 1329 1330 // The following field is only present when the webhook is triggered on 1331 // a repository belonging to an organization. 1332 Organization *Organization `json:"organization,omitempty"` 1333 1334 // The following fields are only populated when the Action is "synchronize". 1335 Before *string `json:"before,omitempty"` 1336 After *string `json:"after,omitempty"` 1337 1338 // The following will be populated if the event was performed by an App 1339 PerformedViaGithubApp *App `json:"performed_via_github_app,omitempty"` 1340 } 1341 1342 // PushEvent represents a git push to a GitHub repository. 1343 // 1344 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#push 1345 type PushEvent struct { 1346 PushID *int64 `json:"push_id,omitempty"` 1347 Head *string `json:"head,omitempty"` 1348 Ref *string `json:"ref,omitempty"` 1349 Size *int `json:"size,omitempty"` 1350 Commits []*HeadCommit `json:"commits,omitempty"` 1351 Before *string `json:"before,omitempty"` 1352 DistinctSize *int `json:"distinct_size,omitempty"` 1353 1354 // The following fields are only populated by Webhook events. 1355 Action *string `json:"action,omitempty"` 1356 After *string `json:"after,omitempty"` 1357 Created *bool `json:"created,omitempty"` 1358 Deleted *bool `json:"deleted,omitempty"` 1359 Forced *bool `json:"forced,omitempty"` 1360 BaseRef *string `json:"base_ref,omitempty"` 1361 Compare *string `json:"compare,omitempty"` 1362 Repo *PushEventRepository `json:"repository,omitempty"` 1363 HeadCommit *HeadCommit `json:"head_commit,omitempty"` 1364 Pusher *CommitAuthor `json:"pusher,omitempty"` 1365 Sender *User `json:"sender,omitempty"` 1366 Installation *Installation `json:"installation,omitempty"` 1367 1368 // The following field is only present when the webhook is triggered on 1369 // a repository belonging to an organization. 1370 Organization *Organization `json:"organization,omitempty"` 1371 } 1372 1373 func (p PushEvent) String() string { 1374 return Stringify(p) 1375 } 1376 1377 // HeadCommit represents a git commit in a GitHub PushEvent. 1378 type HeadCommit struct { 1379 Message *string `json:"message,omitempty"` 1380 Author *CommitAuthor `json:"author,omitempty"` 1381 URL *string `json:"url,omitempty"` 1382 Distinct *bool `json:"distinct,omitempty"` 1383 1384 // The following fields are only populated by Events API. 1385 SHA *string `json:"sha,omitempty"` 1386 1387 // The following fields are only populated by Webhook events. 1388 ID *string `json:"id,omitempty"` 1389 TreeID *string `json:"tree_id,omitempty"` 1390 Timestamp *Timestamp `json:"timestamp,omitempty"` 1391 Committer *CommitAuthor `json:"committer,omitempty"` 1392 Added []string `json:"added,omitempty"` 1393 Removed []string `json:"removed,omitempty"` 1394 Modified []string `json:"modified,omitempty"` 1395 } 1396 1397 func (h HeadCommit) String() string { 1398 return Stringify(h) 1399 } 1400 1401 // PushEventRepository represents the repo object in a PushEvent payload. 1402 type PushEventRepository struct { 1403 ID *int64 `json:"id,omitempty"` 1404 NodeID *string `json:"node_id,omitempty"` 1405 Name *string `json:"name,omitempty"` 1406 FullName *string `json:"full_name,omitempty"` 1407 Owner *User `json:"owner,omitempty"` 1408 Private *bool `json:"private,omitempty"` 1409 Description *string `json:"description,omitempty"` 1410 Fork *bool `json:"fork,omitempty"` 1411 CreatedAt *Timestamp `json:"created_at,omitempty"` 1412 PushedAt *Timestamp `json:"pushed_at,omitempty"` 1413 UpdatedAt *Timestamp `json:"updated_at,omitempty"` 1414 Homepage *string `json:"homepage,omitempty"` 1415 PullsURL *string `json:"pulls_url,omitempty"` 1416 Size *int `json:"size,omitempty"` 1417 StargazersCount *int `json:"stargazers_count,omitempty"` 1418 WatchersCount *int `json:"watchers_count,omitempty"` 1419 Language *string `json:"language,omitempty"` 1420 HasIssues *bool `json:"has_issues,omitempty"` 1421 HasDownloads *bool `json:"has_downloads,omitempty"` 1422 HasWiki *bool `json:"has_wiki,omitempty"` 1423 HasPages *bool `json:"has_pages,omitempty"` 1424 ForksCount *int `json:"forks_count,omitempty"` 1425 Archived *bool `json:"archived,omitempty"` 1426 Disabled *bool `json:"disabled,omitempty"` 1427 OpenIssuesCount *int `json:"open_issues_count,omitempty"` 1428 DefaultBranch *string `json:"default_branch,omitempty"` 1429 MasterBranch *string `json:"master_branch,omitempty"` 1430 Organization *string `json:"organization,omitempty"` 1431 URL *string `json:"url,omitempty"` 1432 ArchiveURL *string `json:"archive_url,omitempty"` 1433 HTMLURL *string `json:"html_url,omitempty"` 1434 StatusesURL *string `json:"statuses_url,omitempty"` 1435 GitURL *string `json:"git_url,omitempty"` 1436 SSHURL *string `json:"ssh_url,omitempty"` 1437 CloneURL *string `json:"clone_url,omitempty"` 1438 SVNURL *string `json:"svn_url,omitempty"` 1439 Topics []string `json:"topics,omitempty"` 1440 CustomProperties map[string]any `json:"custom_properties,omitempty"` 1441 } 1442 1443 // PushEventRepoOwner is a basic representation of user/org in a PushEvent payload. 1444 type PushEventRepoOwner struct { 1445 Name *string `json:"name,omitempty"` 1446 Email *string `json:"email,omitempty"` 1447 } 1448 1449 // RegistryPackageEvent represents activity related to GitHub Packages. 1450 // The Webhook event name is "registry_package". 1451 // 1452 // This event is triggered when a GitHub Package is published or updated. 1453 // 1454 // GitHub API docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#registry_package 1455 type RegistryPackageEvent struct { 1456 // Action is the action that was performed. 1457 // Can be "published" or "updated". 1458 Action *string `json:"action,omitempty"` 1459 RegistryPackage *Package `json:"registry_package,omitempty"` 1460 Repository *Repository `json:"repository,omitempty"` 1461 Organization *Organization `json:"organization,omitempty"` 1462 Enterprise *Enterprise `json:"enterprise,omitempty"` 1463 Sender *User `json:"sender,omitempty"` 1464 1465 // The following fields are only populated by Webhook events. 1466 Installation *Installation `json:"installation,omitempty"` 1467 } 1468 1469 // ReleaseEvent is triggered when a release is published, unpublished, created, 1470 // edited, deleted, or prereleased. 1471 // The Webhook event name is "release". 1472 // 1473 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#release 1474 type ReleaseEvent struct { 1475 // Action is the action that was performed. Possible values are: "published", "unpublished", 1476 // "created", "edited", "deleted", or "prereleased". 1477 Action *string `json:"action,omitempty"` 1478 Release *RepositoryRelease `json:"release,omitempty"` 1479 1480 // The following fields are only populated by Webhook events. 1481 Repo *Repository `json:"repository,omitempty"` 1482 Sender *User `json:"sender,omitempty"` 1483 Installation *Installation `json:"installation,omitempty"` 1484 1485 // The following field is only present when the webhook is triggered on 1486 // a repository belonging to an organization. 1487 Org *Organization `json:"organization,omitempty"` 1488 } 1489 1490 // RepositoryEvent is triggered when a repository is created, archived, unarchived, 1491 // renamed, edited, transferred, made public, or made private. Organization hooks are 1492 // also triggered when a repository is deleted. 1493 // The Webhook event name is "repository". 1494 // 1495 // Events of this type are not visible in timelines, they are only used to 1496 // trigger organization webhooks. 1497 // 1498 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#repository 1499 type RepositoryEvent struct { 1500 // Action is the action that was performed. Possible values are: "created", 1501 // "deleted" (organization hooks only), "archived", "unarchived", "edited", "renamed", 1502 // "transferred", "publicized", or "privatized". 1503 Action *string `json:"action,omitempty"` 1504 Repo *Repository `json:"repository,omitempty"` 1505 1506 // The following fields are only populated by Webhook events. 1507 Changes *EditChange `json:"changes,omitempty"` 1508 Org *Organization `json:"organization,omitempty"` 1509 Sender *User `json:"sender,omitempty"` 1510 Installation *Installation `json:"installation,omitempty"` 1511 } 1512 1513 // RepositoryDispatchEvent is triggered when a client sends a POST request to the repository dispatch event endpoint. 1514 // 1515 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#repository_dispatch 1516 type RepositoryDispatchEvent struct { 1517 // Action is the event_type that submitted with the repository dispatch payload. Value can be any string. 1518 Action *string `json:"action,omitempty"` 1519 Branch *string `json:"branch,omitempty"` 1520 ClientPayload json.RawMessage `json:"client_payload,omitempty"` 1521 Repo *Repository `json:"repository,omitempty"` 1522 1523 // The following fields are only populated by Webhook events. 1524 Org *Organization `json:"organization,omitempty"` 1525 Sender *User `json:"sender,omitempty"` 1526 Installation *Installation `json:"installation,omitempty"` 1527 } 1528 1529 // RepositoryImportEvent represents the activity related to a repository being imported to GitHub. 1530 // 1531 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#repository_import 1532 type RepositoryImportEvent struct { 1533 // Status represents the final state of the import. This can be one of "success", "cancelled", or "failure". 1534 Status *string `json:"status,omitempty"` 1535 Repo *Repository `json:"repository,omitempty"` 1536 Org *Organization `json:"organization,omitempty"` 1537 Sender *User `json:"sender,omitempty"` 1538 } 1539 1540 // RepositoryRulesetEvent triggers whenever there is a change to the repository's ruleset configuration. 1541 // 1542 // This can include updates to protection rules, required status checks, code owners, or other related configurations. 1543 // 1544 // GitHub API docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#repository_ruleset 1545 type RepositoryRulesetEvent struct { 1546 Action *string `json:"action,omitempty"` 1547 Enterprise *Enterprise `json:"enterprise,omitempty"` 1548 Installation *Installation `json:"installation,omitempty"` 1549 Organization *Organization `json:"organization,omitempty"` 1550 Repository *Repository `json:"repository,omitempty"` 1551 RepositoryRuleset *RepositoryRuleset `json:"repository_ruleset"` 1552 Changes *RepositoryRulesetChanges `json:"changes,omitempty"` 1553 Sender *User `json:"sender"` 1554 } 1555 1556 // RepositoryRulesetChanges represents the changes made to a repository ruleset. 1557 type RepositoryRulesetChanges struct { 1558 Name *RepositoryRulesetChangeSource `json:"name,omitempty"` 1559 Enforcement *RepositoryRulesetChangeSource `json:"enforcement,omitempty"` 1560 Conditions *RepositoryRulesetChangedConditions `json:"conditions,omitempty"` 1561 Rules *RepositoryRulesetChangedRules `json:"rules,omitempty"` 1562 } 1563 1564 // RepositoryRulesetChangeSource represents a source change for the ruleset. 1565 type RepositoryRulesetChangeSource struct { 1566 From *string `json:"from,omitempty"` 1567 } 1568 1569 // RepositoryRulesetChangeSources represents multiple source changes for the ruleset. 1570 type RepositoryRulesetChangeSources struct { 1571 From []string `json:"from,omitempty"` 1572 } 1573 1574 // RepositoryRulesetChangedConditions holds changes to conditions in a ruleset. 1575 type RepositoryRulesetChangedConditions struct { 1576 Added []*RepositoryRulesetConditions `json:"added,omitempty"` 1577 Deleted []*RepositoryRulesetConditions `json:"deleted,omitempty"` 1578 Updated []*RepositoryRulesetUpdatedConditions `json:"updated,omitempty"` 1579 } 1580 1581 // RepositoryRulesetUpdatedConditions represents the edited updates to conditions in a ruleset. 1582 type RepositoryRulesetUpdatedConditions struct { 1583 Condition *RepositoryRulesetConditions `json:"condition,omitempty"` 1584 Changes *RepositoryRulesetUpdatedCondition `json:"changes,omitempty"` 1585 } 1586 1587 // RepositoryRulesetUpdatedCondition represents the changes to a condition in a ruleset. 1588 type RepositoryRulesetUpdatedCondition struct { 1589 ConditionType *RepositoryRulesetChangeSource `json:"condition_type,omitempty"` 1590 Target *RepositoryRulesetChangeSource `json:"target,omitempty"` 1591 Include *RepositoryRulesetChangeSources `json:"include,omitempty"` 1592 Exclude *RepositoryRulesetChangeSources `json:"exclude,omitempty"` 1593 } 1594 1595 // RepositoryRulesetChangedRules holds changes to rules in a ruleset. 1596 type RepositoryRulesetChangedRules struct { 1597 Added []*RepositoryRule `json:"added,omitempty"` 1598 Deleted []*RepositoryRule `json:"deleted,omitempty"` 1599 Updated []*RepositoryRulesetUpdatedRules `json:"updated,omitempty"` 1600 } 1601 1602 // RepositoryRulesetUpdatedRules holds updates to rules in a ruleset. 1603 type RepositoryRulesetUpdatedRules struct { 1604 Rule *RepositoryRule `json:"rule,omitempty"` 1605 Changes *RepositoryRulesetChangedRule `json:"changes,omitempty"` 1606 } 1607 1608 // RepositoryRulesetChangedRule holds changes made to a rule in a ruleset. 1609 type RepositoryRulesetChangedRule struct { 1610 Configuration *RepositoryRulesetChangeSource `json:"configuration,omitempty"` 1611 RuleType *RepositoryRulesetChangeSource `json:"rule_type,omitempty"` 1612 Pattern *RepositoryRulesetChangeSource `json:"pattern,omitempty"` 1613 } 1614 1615 // RepositoryVulnerabilityAlertEvent is triggered when a security alert is created, dismissed, or resolved. 1616 // 1617 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#repository_vulnerability_alert 1618 type RepositoryVulnerabilityAlertEvent struct { 1619 // Action is the action that was performed. Possible values are: "create", "dismiss", "resolve". 1620 Action *string `json:"action,omitempty"` 1621 1622 // The security alert of the vulnerable dependency. 1623 Alert *RepositoryVulnerabilityAlert `json:"alert,omitempty"` 1624 1625 // The repository of the vulnerable dependency. 1626 Repository *Repository `json:"repository,omitempty"` 1627 1628 // The following fields are only populated by Webhook events. 1629 Installation *Installation `json:"installation,omitempty"` 1630 1631 // The user that triggered the event. 1632 Sender *User `json:"sender,omitempty"` 1633 1634 // The following field is only present when the webhook is triggered on 1635 // a repository belonging to an organization. 1636 Org *Organization `json:"organization,omitempty"` 1637 } 1638 1639 // RepositoryVulnerabilityAlert represents a repository security alert. 1640 type RepositoryVulnerabilityAlert struct { 1641 ID *int64 `json:"id,omitempty"` 1642 AffectedRange *string `json:"affected_range,omitempty"` 1643 AffectedPackageName *string `json:"affected_package_name,omitempty"` 1644 ExternalReference *string `json:"external_reference,omitempty"` 1645 ExternalIdentifier *string `json:"external_identifier,omitempty"` 1646 GitHubSecurityAdvisoryID *string `json:"ghsa_id,omitempty"` 1647 Severity *string `json:"severity,omitempty"` 1648 CreatedAt *Timestamp `json:"created_at,omitempty"` 1649 FixedIn *string `json:"fixed_in,omitempty"` 1650 Dismisser *User `json:"dismisser,omitempty"` 1651 DismissReason *string `json:"dismiss_reason,omitempty"` 1652 DismissedAt *Timestamp `json:"dismissed_at,omitempty"` 1653 } 1654 1655 // SecretScanningAlertEvent is triggered when a secret scanning alert occurs in a repository. 1656 // The Webhook name is secret_scanning_alert. 1657 // 1658 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#secret_scanning_alert 1659 type SecretScanningAlertEvent struct { 1660 // Action is the action that was performed. Possible values are: "created", "resolved", or "reopened". 1661 Action *string `json:"action,omitempty"` 1662 1663 // Alert is the secret scanning alert involved in the event. 1664 Alert *SecretScanningAlert `json:"alert,omitempty"` 1665 1666 // Only populated by the "resolved" and "reopen" actions 1667 Sender *User `json:"sender,omitempty"` 1668 // The following fields are only populated by Webhook events. 1669 Repo *Repository `json:"repository,omitempty"` 1670 Organization *Organization `json:"organization,omitempty"` 1671 Enterprise *Enterprise `json:"enterprise,omitempty"` 1672 Installation *Installation `json:"installation,omitempty"` 1673 } 1674 1675 // SecretScanningAlertLocationEvent is triggered when there is activity relating to the locations of a secret in a secret scanning alert. 1676 // The Webhook event name is "secret_scanning_alert_location". 1677 // 1678 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#secret_scanning_alert_location 1679 type SecretScanningAlertLocationEvent struct { 1680 Action *string `json:"action,omitempty"` 1681 Alert *SecretScanningAlert `json:"alert,omitempty"` 1682 Installation *Installation `json:"installation,omitempty"` 1683 Location *SecretScanningAlertLocation `json:"location,omitempty"` 1684 Organization *Organization `json:"organization,omitempty"` 1685 Repo *Repository `json:"repository,omitempty"` 1686 Sender *User `json:"sender,omitempty"` 1687 } 1688 1689 // SecurityAndAnalysisEvent is triggered when code security and analysis features 1690 // are enabled or disabled for a repository. 1691 // 1692 // GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#security_and_analysis 1693 type SecurityAndAnalysisEvent struct { 1694 Changes *SecurityAndAnalysisChange `json:"changes,omitempty"` 1695 Enterprise *Enterprise `json:"enterprise,omitempty"` 1696 Installation *Installation `json:"installation,omitempty"` 1697 Organization *Organization `json:"organization,omitempty"` 1698 Repository *Repository `json:"repository,omitempty"` 1699 Sender *User `json:"sender,omitempty"` 1700 } 1701 1702 // SecurityAndAnalysisChange represents the changes when security and analysis 1703 // features are enabled or disabled for a repository. 1704 type SecurityAndAnalysisChange struct { 1705 From *SecurityAndAnalysisChangeFrom `json:"from,omitempty"` 1706 } 1707 1708 // SecurityAndAnalysisChangeFrom represents which change was made when security 1709 // and analysis features are enabled or disabled for a repository. 1710 type SecurityAndAnalysisChangeFrom struct { 1711 SecurityAndAnalysis *SecurityAndAnalysis `json:"security_and_analysis,omitempty"` 1712 } 1713 1714 // StarEvent is triggered when a star is added or removed from a repository. 1715 // The Webhook event name is "star". 1716 // 1717 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#star 1718 type StarEvent struct { 1719 // Action is the action that was performed. Possible values are: "created" or "deleted". 1720 Action *string `json:"action,omitempty"` 1721 1722 // StarredAt is the time the star was created. It will be null for the "deleted" action. 1723 StarredAt *Timestamp `json:"starred_at,omitempty"` 1724 1725 // The following fields are only populated by Webhook events. 1726 Org *Organization `json:"organization,omitempty"` 1727 Repo *Repository `json:"repository,omitempty"` 1728 Sender *User `json:"sender,omitempty"` 1729 Installation *Installation `json:"installation,omitempty"` 1730 } 1731 1732 // StatusEvent is triggered when the status of a Git commit changes. 1733 // The Webhook event name is "status". 1734 // 1735 // Events of this type are not visible in timelines, they are only used to 1736 // trigger hooks. 1737 // 1738 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#status 1739 type StatusEvent struct { 1740 SHA *string `json:"sha,omitempty"` 1741 // State is the new state. Possible values are: "pending", "success", "failure", "error". 1742 State *string `json:"state,omitempty"` 1743 Description *string `json:"description,omitempty"` 1744 TargetURL *string `json:"target_url,omitempty"` 1745 Branches []*Branch `json:"branches,omitempty"` 1746 1747 // The following fields are only populated by Webhook events. 1748 ID *int64 `json:"id,omitempty"` 1749 Name *string `json:"name,omitempty"` 1750 Context *string `json:"context,omitempty"` 1751 Commit *RepositoryCommit `json:"commit,omitempty"` 1752 CreatedAt *Timestamp `json:"created_at,omitempty"` 1753 UpdatedAt *Timestamp `json:"updated_at,omitempty"` 1754 Repo *Repository `json:"repository,omitempty"` 1755 Sender *User `json:"sender,omitempty"` 1756 Installation *Installation `json:"installation,omitempty"` 1757 1758 // The following field is only present when the webhook is triggered on 1759 // a repository belonging to an organization. 1760 Org *Organization `json:"organization,omitempty"` 1761 } 1762 1763 // TeamEvent is triggered when an organization's team is created, modified or deleted. 1764 // The Webhook event name is "team". 1765 // 1766 // Events of this type are not visible in timelines. These events are only used 1767 // to trigger hooks. 1768 // 1769 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#team 1770 type TeamEvent struct { 1771 Action *string `json:"action,omitempty"` 1772 Team *Team `json:"team,omitempty"` 1773 Changes *TeamChange `json:"changes,omitempty"` 1774 Repo *Repository `json:"repository,omitempty"` 1775 1776 // The following fields are only populated by Webhook events. 1777 Org *Organization `json:"organization,omitempty"` 1778 Sender *User `json:"sender,omitempty"` 1779 Installation *Installation `json:"installation,omitempty"` 1780 } 1781 1782 // TeamAddEvent is triggered when a repository is added to a team. 1783 // The Webhook event name is "team_add". 1784 // 1785 // Events of this type are not visible in timelines. These events are only used 1786 // to trigger hooks. 1787 // 1788 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#team_add 1789 type TeamAddEvent struct { 1790 Team *Team `json:"team,omitempty"` 1791 Repo *Repository `json:"repository,omitempty"` 1792 1793 // The following fields are only populated by Webhook events. 1794 Org *Organization `json:"organization,omitempty"` 1795 Sender *User `json:"sender,omitempty"` 1796 Installation *Installation `json:"installation,omitempty"` 1797 } 1798 1799 // UserEvent is triggered when a user is created or deleted. 1800 // The Webhook event name is "user". 1801 // 1802 // Only global webhooks can subscribe to this event type. 1803 // 1804 // GitHub API docs: https://developer.github.com/enterprise/v3/activity/events/types/#userevent-enterprise 1805 type UserEvent struct { 1806 User *User `json:"user,omitempty"` 1807 // The action performed. Possible values are: "created" or "deleted". 1808 Action *string `json:"action,omitempty"` 1809 Enterprise *Enterprise `json:"enterprise,omitempty"` 1810 Sender *User `json:"sender,omitempty"` 1811 1812 // The following fields are only populated by Webhook events. 1813 Installation *Installation `json:"installation,omitempty"` 1814 } 1815 1816 // WatchEvent is related to starring a repository, not watching. See this API 1817 // blog post for an explanation: https://developer.github.com/changes/2012-09-05-watcher-api/ 1818 // 1819 // The event’s actor is the user who starred a repository, and the event’s 1820 // repository is the repository that was starred. 1821 // 1822 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#watch 1823 type WatchEvent struct { 1824 // Action is the action that was performed. Possible value is: "started". 1825 Action *string `json:"action,omitempty"` 1826 1827 // The following fields are only populated by Webhook events. 1828 Repo *Repository `json:"repository,omitempty"` 1829 Sender *User `json:"sender,omitempty"` 1830 Installation *Installation `json:"installation,omitempty"` 1831 1832 // The following field is only present when the webhook is triggered on 1833 // a repository belonging to an organization. 1834 Org *Organization `json:"organization,omitempty"` 1835 } 1836 1837 // WorkflowDispatchEvent is triggered when someone triggers a workflow run on GitHub or 1838 // sends a POST request to the create a workflow dispatch event endpoint. 1839 // 1840 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch 1841 type WorkflowDispatchEvent struct { 1842 Inputs json.RawMessage `json:"inputs,omitempty"` 1843 Ref *string `json:"ref,omitempty"` 1844 Workflow *string `json:"workflow,omitempty"` 1845 1846 // The following fields are only populated by Webhook events. 1847 Repo *Repository `json:"repository,omitempty"` 1848 Org *Organization `json:"organization,omitempty"` 1849 Sender *User `json:"sender,omitempty"` 1850 Installation *Installation `json:"installation,omitempty"` 1851 } 1852 1853 // WorkflowJobEvent is triggered when a job is queued, started or completed. 1854 // 1855 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_job 1856 type WorkflowJobEvent struct { 1857 WorkflowJob *WorkflowJob `json:"workflow_job,omitempty"` 1858 1859 Action *string `json:"action,omitempty"` 1860 1861 // The following fields are only populated by Webhook events. 1862 1863 // Org is not nil when the webhook is configured for an organization or the event 1864 // occurs from activity in a repository owned by an organization. 1865 Org *Organization `json:"organization,omitempty"` 1866 Repo *Repository `json:"repository,omitempty"` 1867 Sender *User `json:"sender,omitempty"` 1868 Installation *Installation `json:"installation,omitempty"` 1869 Deployment *Deployment `json:"deployment,omitempty"` 1870 } 1871 1872 // WorkflowRunEvent is triggered when a GitHub Actions workflow run is requested or completed. 1873 // 1874 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#workflow_run 1875 type WorkflowRunEvent struct { 1876 Action *string `json:"action,omitempty"` 1877 Workflow *Workflow `json:"workflow,omitempty"` 1878 WorkflowRun *WorkflowRun `json:"workflow_run,omitempty"` 1879 1880 // The following fields are only populated by Webhook events. 1881 Org *Organization `json:"organization,omitempty"` 1882 Repo *Repository `json:"repository,omitempty"` 1883 Sender *User `json:"sender,omitempty"` 1884 Installation *Installation `json:"installation,omitempty"` 1885 } 1886 1887 // SecurityAdvisory represents the advisory object in SecurityAdvisoryEvent payload. 1888 // 1889 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#security_advisory 1890 type SecurityAdvisory struct { 1891 CVSS *AdvisoryCVSS `json:"cvss,omitempty"` 1892 CWEs []*AdvisoryCWEs `json:"cwes,omitempty"` 1893 GHSAID *string `json:"ghsa_id,omitempty"` 1894 Summary *string `json:"summary,omitempty"` 1895 Description *string `json:"description,omitempty"` 1896 Severity *string `json:"severity,omitempty"` 1897 Identifiers []*AdvisoryIdentifier `json:"identifiers,omitempty"` 1898 References []*AdvisoryReference `json:"references,omitempty"` 1899 PublishedAt *Timestamp `json:"published_at,omitempty"` 1900 UpdatedAt *Timestamp `json:"updated_at,omitempty"` 1901 WithdrawnAt *Timestamp `json:"withdrawn_at,omitempty"` 1902 Vulnerabilities []*AdvisoryVulnerability `json:"vulnerabilities,omitempty"` 1903 CVEID *string `json:"cve_id,omitempty"` 1904 URL *string `json:"url,omitempty"` 1905 HTMLURL *string `json:"html_url,omitempty"` 1906 Author *User `json:"author,omitempty"` 1907 Publisher *User `json:"publisher,omitempty"` 1908 State *string `json:"state,omitempty"` 1909 CreatedAt *Timestamp `json:"created_at,omitempty"` 1910 ClosedAt *Timestamp `json:"closed_at,omitempty"` 1911 Submission *SecurityAdvisorySubmission `json:"submission,omitempty"` 1912 CWEIDs []string `json:"cwe_ids,omitempty"` 1913 Credits []*RepoAdvisoryCredit `json:"credits,omitempty"` 1914 CreditsDetailed []*RepoAdvisoryCreditDetailed `json:"credits_detailed,omitempty"` 1915 CollaboratingUsers []*User `json:"collaborating_users,omitempty"` 1916 CollaboratingTeams []*Team `json:"collaborating_teams,omitempty"` 1917 PrivateFork *Repository `json:"private_fork,omitempty"` 1918 } 1919 1920 // AdvisoryIdentifier represents the identifier for a Security Advisory. 1921 type AdvisoryIdentifier struct { 1922 Value *string `json:"value,omitempty"` 1923 Type *string `json:"type,omitempty"` 1924 } 1925 1926 // AdvisoryReference represents the reference url for the security advisory. 1927 type AdvisoryReference struct { 1928 URL *string `json:"url,omitempty"` 1929 } 1930 1931 // AdvisoryVulnerability represents the vulnerability object for a Security Advisory. 1932 type AdvisoryVulnerability struct { 1933 Package *VulnerabilityPackage `json:"package,omitempty"` 1934 Severity *string `json:"severity,omitempty"` 1935 VulnerableVersionRange *string `json:"vulnerable_version_range,omitempty"` 1936 FirstPatchedVersion *FirstPatchedVersion `json:"first_patched_version,omitempty"` 1937 1938 // PatchedVersions and VulnerableFunctions are used in the following APIs: 1939 // - https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories-for-an-organization 1940 // - https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories 1941 PatchedVersions *string `json:"patched_versions,omitempty"` 1942 VulnerableFunctions []string `json:"vulnerable_functions,omitempty"` 1943 } 1944 1945 // VulnerabilityPackage represents the package object for an Advisory Vulnerability. 1946 type VulnerabilityPackage struct { 1947 Ecosystem *string `json:"ecosystem,omitempty"` 1948 Name *string `json:"name,omitempty"` 1949 } 1950 1951 // FirstPatchedVersion represents the identifier for the first patched version of that vulnerability. 1952 type FirstPatchedVersion struct { 1953 Identifier *string `json:"identifier,omitempty"` 1954 } 1955 1956 // SecurityAdvisoryEvent is triggered when a security-related vulnerability is found in software on GitHub. 1957 // 1958 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#security_advisory 1959 type SecurityAdvisoryEvent struct { 1960 Action *string `json:"action,omitempty"` 1961 SecurityAdvisory *SecurityAdvisory `json:"security_advisory,omitempty"` 1962 1963 // The following fields are only populated by Webhook events. 1964 Enterprise *Enterprise `json:"enterprise,omitempty"` 1965 Installation *Installation `json:"installation,omitempty"` 1966 Organization *Organization `json:"organization,omitempty"` 1967 Repository *Repository `json:"repository,omitempty"` 1968 Sender *User `json:"sender,omitempty"` 1969 } 1970 1971 // CodeScanningAlertEvent is triggered when a code scanning finds a potential vulnerability or error in your code. 1972 // 1973 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#code_scanning_alert 1974 type CodeScanningAlertEvent struct { 1975 Action *string `json:"action,omitempty"` 1976 Alert *Alert `json:"alert,omitempty"` 1977 Ref *string `json:"ref,omitempty"` 1978 // CommitOID is the commit SHA of the code scanning alert 1979 CommitOID *string `json:"commit_oid,omitempty"` 1980 Repo *Repository `json:"repository,omitempty"` 1981 Org *Organization `json:"organization,omitempty"` 1982 Sender *User `json:"sender,omitempty"` 1983 1984 Installation *Installation `json:"installation,omitempty"` 1985 } 1986 1987 // SponsorshipEvent represents a sponsorship event in GitHub. 1988 // 1989 // GitHub API docs: https://docs.github.com/en/rest/overview/github-event-types?apiVersion=2022-11-28#sponsorshipevent 1990 type SponsorshipEvent struct { 1991 Action *string `json:"action,omitempty"` 1992 EffectiveDate *string `json:"effective_date,omitempty"` 1993 Changes *SponsorshipChanges `json:"changes,omitempty"` 1994 Repository *Repository `json:"repository,omitempty"` 1995 Organization *Organization `json:"organization,omitempty"` 1996 Sender *User `json:"sender,omitempty"` 1997 Installation *Installation `json:"installation,omitempty"` 1998 } 1999 2000 // SponsorshipChanges represents changes made to the sponsorship. 2001 type SponsorshipChanges struct { 2002 Tier *SponsorshipTier `json:"tier,omitempty"` 2003 PrivacyLevel *string `json:"privacy_level,omitempty"` 2004 } 2005 2006 // SponsorshipTier represents the tier information of a sponsorship. 2007 type SponsorshipTier struct { 2008 From *string `json:"from,omitempty"` 2009 }