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