github.com/google/go-github/v70@v70.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]interface{} `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 // ReleaseEvent is triggered when a release is published, unpublished, created, 1450 // edited, deleted, or prereleased. 1451 // The Webhook event name is "release". 1452 // 1453 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#release 1454 type ReleaseEvent struct { 1455 // Action is the action that was performed. Possible values are: "published", "unpublished", 1456 // "created", "edited", "deleted", or "prereleased". 1457 Action *string `json:"action,omitempty"` 1458 Release *RepositoryRelease `json:"release,omitempty"` 1459 1460 // The following fields are only populated by Webhook events. 1461 Repo *Repository `json:"repository,omitempty"` 1462 Sender *User `json:"sender,omitempty"` 1463 Installation *Installation `json:"installation,omitempty"` 1464 1465 // The following field is only present when the webhook is triggered on 1466 // a repository belonging to an organization. 1467 Org *Organization `json:"organization,omitempty"` 1468 } 1469 1470 // RepositoryEvent is triggered when a repository is created, archived, unarchived, 1471 // renamed, edited, transferred, made public, or made private. Organization hooks are 1472 // also triggered when a repository is deleted. 1473 // The Webhook event name is "repository". 1474 // 1475 // Events of this type are not visible in timelines, they are only used to 1476 // trigger organization webhooks. 1477 // 1478 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#repository 1479 type RepositoryEvent struct { 1480 // Action is the action that was performed. Possible values are: "created", 1481 // "deleted" (organization hooks only), "archived", "unarchived", "edited", "renamed", 1482 // "transferred", "publicized", or "privatized". 1483 Action *string `json:"action,omitempty"` 1484 Repo *Repository `json:"repository,omitempty"` 1485 1486 // The following fields are only populated by Webhook events. 1487 Changes *EditChange `json:"changes,omitempty"` 1488 Org *Organization `json:"organization,omitempty"` 1489 Sender *User `json:"sender,omitempty"` 1490 Installation *Installation `json:"installation,omitempty"` 1491 } 1492 1493 // RepositoryDispatchEvent is triggered when a client sends a POST request to the repository dispatch event endpoint. 1494 // 1495 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#repository_dispatch 1496 type RepositoryDispatchEvent struct { 1497 // Action is the event_type that submitted with the repository dispatch payload. Value can be any string. 1498 Action *string `json:"action,omitempty"` 1499 Branch *string `json:"branch,omitempty"` 1500 ClientPayload json.RawMessage `json:"client_payload,omitempty"` 1501 Repo *Repository `json:"repository,omitempty"` 1502 1503 // The following fields are only populated by Webhook events. 1504 Org *Organization `json:"organization,omitempty"` 1505 Sender *User `json:"sender,omitempty"` 1506 Installation *Installation `json:"installation,omitempty"` 1507 } 1508 1509 // RepositoryImportEvent represents the activity related to a repository being imported to GitHub. 1510 // 1511 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#repository_import 1512 type RepositoryImportEvent struct { 1513 // Status represents the final state of the import. This can be one of "success", "cancelled", or "failure". 1514 Status *string `json:"status,omitempty"` 1515 Repo *Repository `json:"repository,omitempty"` 1516 Org *Organization `json:"organization,omitempty"` 1517 Sender *User `json:"sender,omitempty"` 1518 } 1519 1520 // RepositoryRulesetEvent triggers whenever there is a change to the repository's ruleset configuration. 1521 // 1522 // This can include updates to protection rules, required status checks, code owners, or other related configurations. 1523 // 1524 // GitHub API docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#repository_ruleset 1525 type RepositoryRulesetEvent struct { 1526 Action *string `json:"action,omitempty"` 1527 Enterprise *Enterprise `json:"enterprise,omitempty"` 1528 Installation *Installation `json:"installation,omitempty"` 1529 Organization *Organization `json:"organization,omitempty"` 1530 Repository *Repository `json:"repository,omitempty"` 1531 RepositoryRuleset *RepositoryRuleset `json:"repository_ruleset"` 1532 Changes *RepositoryRulesetChanges `json:"changes,omitempty"` 1533 Sender *User `json:"sender"` 1534 } 1535 1536 // RepositoryRulesetChanges represents the changes made to a repository ruleset. 1537 type RepositoryRulesetChanges struct { 1538 Name *RepositoryRulesetChangeSource `json:"name,omitempty"` 1539 Enforcement *RepositoryRulesetChangeSource `json:"enforcement,omitempty"` 1540 Conditions *RepositoryRulesetChangedConditions `json:"conditions,omitempty"` 1541 Rules *RepositoryRulesetChangedRules `json:"rules,omitempty"` 1542 } 1543 1544 // RepositoryRulesetChangeSource represents a source change for the ruleset. 1545 type RepositoryRulesetChangeSource struct { 1546 From *string `json:"from,omitempty"` 1547 } 1548 1549 // RepositoryRulesetChangeSources represents multiple source changes for the ruleset. 1550 type RepositoryRulesetChangeSources struct { 1551 From []string `json:"from,omitempty"` 1552 } 1553 1554 // RepositoryRulesetChangedConditions holds changes to conditions in a ruleset. 1555 type RepositoryRulesetChangedConditions struct { 1556 Added []*RepositoryRulesetConditions `json:"added,omitempty"` 1557 Deleted []*RepositoryRulesetConditions `json:"deleted,omitempty"` 1558 Updated []*RepositoryRulesetUpdatedConditions `json:"updated,omitempty"` 1559 } 1560 1561 // RepositoryRulesetUpdatedConditions represents the edited updates to conditions in a ruleset. 1562 type RepositoryRulesetUpdatedConditions struct { 1563 Condition *RepositoryRulesetConditions `json:"condition,omitempty"` 1564 Changes *RepositoryRulesetUpdatedCondition `json:"changes,omitempty"` 1565 } 1566 1567 // RepositoryRulesetUpdatedCondition represents the changes to a condition in a ruleset. 1568 type RepositoryRulesetUpdatedCondition struct { 1569 ConditionType *RepositoryRulesetChangeSource `json:"condition_type,omitempty"` 1570 Target *RepositoryRulesetChangeSource `json:"target,omitempty"` 1571 Include *RepositoryRulesetChangeSources `json:"include,omitempty"` 1572 Exclude *RepositoryRulesetChangeSources `json:"exclude,omitempty"` 1573 } 1574 1575 // RepositoryRulesetChangedRules holds changes to rules in a ruleset. 1576 type RepositoryRulesetChangedRules struct { 1577 Added []*RepositoryRule `json:"added,omitempty"` 1578 Deleted []*RepositoryRule `json:"deleted,omitempty"` 1579 Updated []*RepositoryRulesetUpdatedRules `json:"updated,omitempty"` 1580 } 1581 1582 // RepositoryRulesetUpdatedRules holds updates to rules in a ruleset. 1583 type RepositoryRulesetUpdatedRules struct { 1584 Rule *RepositoryRule `json:"rule,omitempty"` 1585 Changes *RepositoryRulesetChangedRule `json:"changes,omitempty"` 1586 } 1587 1588 // RepositoryRulesetChangedRule holds changes made to a rule in a ruleset. 1589 type RepositoryRulesetChangedRule struct { 1590 Configuration *RepositoryRulesetChangeSource `json:"configuration,omitempty"` 1591 RuleType *RepositoryRulesetChangeSource `json:"rule_type,omitempty"` 1592 Pattern *RepositoryRulesetChangeSource `json:"pattern,omitempty"` 1593 } 1594 1595 // RepositoryVulnerabilityAlertEvent is triggered when a security alert is created, dismissed, or resolved. 1596 // 1597 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#repository_vulnerability_alert 1598 type RepositoryVulnerabilityAlertEvent struct { 1599 // Action is the action that was performed. Possible values are: "create", "dismiss", "resolve". 1600 Action *string `json:"action,omitempty"` 1601 1602 // The security alert of the vulnerable dependency. 1603 Alert *RepositoryVulnerabilityAlert `json:"alert,omitempty"` 1604 1605 // The repository of the vulnerable dependency. 1606 Repository *Repository `json:"repository,omitempty"` 1607 1608 // The following fields are only populated by Webhook events. 1609 Installation *Installation `json:"installation,omitempty"` 1610 1611 // The user that triggered the event. 1612 Sender *User `json:"sender,omitempty"` 1613 1614 // The following field is only present when the webhook is triggered on 1615 // a repository belonging to an organization. 1616 Org *Organization `json:"organization,omitempty"` 1617 } 1618 1619 // RepositoryVulnerabilityAlert represents a repository security alert. 1620 type RepositoryVulnerabilityAlert struct { 1621 ID *int64 `json:"id,omitempty"` 1622 AffectedRange *string `json:"affected_range,omitempty"` 1623 AffectedPackageName *string `json:"affected_package_name,omitempty"` 1624 ExternalReference *string `json:"external_reference,omitempty"` 1625 ExternalIdentifier *string `json:"external_identifier,omitempty"` 1626 GitHubSecurityAdvisoryID *string `json:"ghsa_id,omitempty"` 1627 Severity *string `json:"severity,omitempty"` 1628 CreatedAt *Timestamp `json:"created_at,omitempty"` 1629 FixedIn *string `json:"fixed_in,omitempty"` 1630 Dismisser *User `json:"dismisser,omitempty"` 1631 DismissReason *string `json:"dismiss_reason,omitempty"` 1632 DismissedAt *Timestamp `json:"dismissed_at,omitempty"` 1633 } 1634 1635 // SecretScanningAlertEvent is triggered when a secret scanning alert occurs in a repository. 1636 // The Webhook name is secret_scanning_alert. 1637 // 1638 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#secret_scanning_alert 1639 type SecretScanningAlertEvent struct { 1640 // Action is the action that was performed. Possible values are: "created", "resolved", or "reopened". 1641 Action *string `json:"action,omitempty"` 1642 1643 // Alert is the secret scanning alert involved in the event. 1644 Alert *SecretScanningAlert `json:"alert,omitempty"` 1645 1646 // Only populated by the "resolved" and "reopen" actions 1647 Sender *User `json:"sender,omitempty"` 1648 // The following fields are only populated by Webhook events. 1649 Repo *Repository `json:"repository,omitempty"` 1650 Organization *Organization `json:"organization,omitempty"` 1651 Enterprise *Enterprise `json:"enterprise,omitempty"` 1652 Installation *Installation `json:"installation,omitempty"` 1653 } 1654 1655 // SecretScanningAlertLocationEvent is triggered when there is activity relating to the locations of a secret in a secret scanning alert. 1656 // The Webhook event name is "secret_scanning_alert_location". 1657 // 1658 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#secret_scanning_alert_location 1659 type SecretScanningAlertLocationEvent struct { 1660 Action *string `json:"action,omitempty"` 1661 Alert *SecretScanningAlert `json:"alert,omitempty"` 1662 Installation *Installation `json:"installation,omitempty"` 1663 Location *SecretScanningAlertLocation `json:"location,omitempty"` 1664 Organization *Organization `json:"organization,omitempty"` 1665 Repo *Repository `json:"repository,omitempty"` 1666 Sender *User `json:"sender,omitempty"` 1667 } 1668 1669 // SecurityAndAnalysisEvent is triggered when code security and analysis features 1670 // are enabled or disabled for a repository. 1671 // 1672 // GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#security_and_analysis 1673 type SecurityAndAnalysisEvent struct { 1674 Changes *SecurityAndAnalysisChange `json:"changes,omitempty"` 1675 Enterprise *Enterprise `json:"enterprise,omitempty"` 1676 Installation *Installation `json:"installation,omitempty"` 1677 Organization *Organization `json:"organization,omitempty"` 1678 Repository *Repository `json:"repository,omitempty"` 1679 Sender *User `json:"sender,omitempty"` 1680 } 1681 1682 // SecurityAndAnalysisChange represents the changes when security and analysis 1683 // features are enabled or disabled for a repository. 1684 type SecurityAndAnalysisChange struct { 1685 From *SecurityAndAnalysisChangeFrom `json:"from,omitempty"` 1686 } 1687 1688 // SecurityAndAnalysisChangeFrom represents which change was made when security 1689 // and analysis features are enabled or disabled for a repository. 1690 type SecurityAndAnalysisChangeFrom struct { 1691 SecurityAndAnalysis *SecurityAndAnalysis `json:"security_and_analysis,omitempty"` 1692 } 1693 1694 // StarEvent is triggered when a star is added or removed from a repository. 1695 // The Webhook event name is "star". 1696 // 1697 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#star 1698 type StarEvent struct { 1699 // Action is the action that was performed. Possible values are: "created" or "deleted". 1700 Action *string `json:"action,omitempty"` 1701 1702 // StarredAt is the time the star was created. It will be null for the "deleted" action. 1703 StarredAt *Timestamp `json:"starred_at,omitempty"` 1704 1705 // The following fields are only populated by Webhook events. 1706 Org *Organization `json:"organization,omitempty"` 1707 Repo *Repository `json:"repository,omitempty"` 1708 Sender *User `json:"sender,omitempty"` 1709 Installation *Installation `json:"installation,omitempty"` 1710 } 1711 1712 // StatusEvent is triggered when the status of a Git commit changes. 1713 // The Webhook event name is "status". 1714 // 1715 // Events of this type are not visible in timelines, they are only used to 1716 // trigger hooks. 1717 // 1718 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#status 1719 type StatusEvent struct { 1720 SHA *string `json:"sha,omitempty"` 1721 // State is the new state. Possible values are: "pending", "success", "failure", "error". 1722 State *string `json:"state,omitempty"` 1723 Description *string `json:"description,omitempty"` 1724 TargetURL *string `json:"target_url,omitempty"` 1725 Branches []*Branch `json:"branches,omitempty"` 1726 1727 // The following fields are only populated by Webhook events. 1728 ID *int64 `json:"id,omitempty"` 1729 Name *string `json:"name,omitempty"` 1730 Context *string `json:"context,omitempty"` 1731 Commit *RepositoryCommit `json:"commit,omitempty"` 1732 CreatedAt *Timestamp `json:"created_at,omitempty"` 1733 UpdatedAt *Timestamp `json:"updated_at,omitempty"` 1734 Repo *Repository `json:"repository,omitempty"` 1735 Sender *User `json:"sender,omitempty"` 1736 Installation *Installation `json:"installation,omitempty"` 1737 1738 // The following field is only present when the webhook is triggered on 1739 // a repository belonging to an organization. 1740 Org *Organization `json:"organization,omitempty"` 1741 } 1742 1743 // TeamEvent is triggered when an organization's team is created, modified or deleted. 1744 // The Webhook event name is "team". 1745 // 1746 // Events of this type are not visible in timelines. These events are only used 1747 // to trigger hooks. 1748 // 1749 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#team 1750 type TeamEvent struct { 1751 Action *string `json:"action,omitempty"` 1752 Team *Team `json:"team,omitempty"` 1753 Changes *TeamChange `json:"changes,omitempty"` 1754 Repo *Repository `json:"repository,omitempty"` 1755 1756 // The following fields are only populated by Webhook events. 1757 Org *Organization `json:"organization,omitempty"` 1758 Sender *User `json:"sender,omitempty"` 1759 Installation *Installation `json:"installation,omitempty"` 1760 } 1761 1762 // TeamAddEvent is triggered when a repository is added to a team. 1763 // The Webhook event name is "team_add". 1764 // 1765 // Events of this type are not visible in timelines. These events are only used 1766 // to trigger hooks. 1767 // 1768 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#team_add 1769 type TeamAddEvent struct { 1770 Team *Team `json:"team,omitempty"` 1771 Repo *Repository `json:"repository,omitempty"` 1772 1773 // The following fields are only populated by Webhook events. 1774 Org *Organization `json:"organization,omitempty"` 1775 Sender *User `json:"sender,omitempty"` 1776 Installation *Installation `json:"installation,omitempty"` 1777 } 1778 1779 // UserEvent is triggered when a user is created or deleted. 1780 // The Webhook event name is "user". 1781 // 1782 // Only global webhooks can subscribe to this event type. 1783 // 1784 // GitHub API docs: https://developer.github.com/enterprise/v3/activity/events/types/#userevent-enterprise 1785 type UserEvent struct { 1786 User *User `json:"user,omitempty"` 1787 // The action performed. Possible values are: "created" or "deleted". 1788 Action *string `json:"action,omitempty"` 1789 Enterprise *Enterprise `json:"enterprise,omitempty"` 1790 Sender *User `json:"sender,omitempty"` 1791 1792 // The following fields are only populated by Webhook events. 1793 Installation *Installation `json:"installation,omitempty"` 1794 } 1795 1796 // WatchEvent is related to starring a repository, not watching. See this API 1797 // blog post for an explanation: https://developer.github.com/changes/2012-09-05-watcher-api/ 1798 // 1799 // The event’s actor is the user who starred a repository, and the event’s 1800 // repository is the repository that was starred. 1801 // 1802 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#watch 1803 type WatchEvent struct { 1804 // Action is the action that was performed. Possible value is: "started". 1805 Action *string `json:"action,omitempty"` 1806 1807 // The following fields are only populated by Webhook events. 1808 Repo *Repository `json:"repository,omitempty"` 1809 Sender *User `json:"sender,omitempty"` 1810 Installation *Installation `json:"installation,omitempty"` 1811 1812 // The following field is only present when the webhook is triggered on 1813 // a repository belonging to an organization. 1814 Org *Organization `json:"organization,omitempty"` 1815 } 1816 1817 // WorkflowDispatchEvent is triggered when someone triggers a workflow run on GitHub or 1818 // sends a POST request to the create a workflow dispatch event endpoint. 1819 // 1820 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch 1821 type WorkflowDispatchEvent struct { 1822 Inputs json.RawMessage `json:"inputs,omitempty"` 1823 Ref *string `json:"ref,omitempty"` 1824 Workflow *string `json:"workflow,omitempty"` 1825 1826 // The following fields are only populated by Webhook events. 1827 Repo *Repository `json:"repository,omitempty"` 1828 Org *Organization `json:"organization,omitempty"` 1829 Sender *User `json:"sender,omitempty"` 1830 Installation *Installation `json:"installation,omitempty"` 1831 } 1832 1833 // WorkflowJobEvent is triggered when a job is queued, started or completed. 1834 // 1835 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_job 1836 type WorkflowJobEvent struct { 1837 WorkflowJob *WorkflowJob `json:"workflow_job,omitempty"` 1838 1839 Action *string `json:"action,omitempty"` 1840 1841 // The following fields are only populated by Webhook events. 1842 1843 // Org is not nil when the webhook is configured for an organization or the event 1844 // occurs from activity in a repository owned by an organization. 1845 Org *Organization `json:"organization,omitempty"` 1846 Repo *Repository `json:"repository,omitempty"` 1847 Sender *User `json:"sender,omitempty"` 1848 Installation *Installation `json:"installation,omitempty"` 1849 Deployment *Deployment `json:"deployment,omitempty"` 1850 } 1851 1852 // WorkflowRunEvent is triggered when a GitHub Actions workflow run is requested or completed. 1853 // 1854 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#workflow_run 1855 type WorkflowRunEvent struct { 1856 Action *string `json:"action,omitempty"` 1857 Workflow *Workflow `json:"workflow,omitempty"` 1858 WorkflowRun *WorkflowRun `json:"workflow_run,omitempty"` 1859 1860 // The following fields are only populated by Webhook events. 1861 Org *Organization `json:"organization,omitempty"` 1862 Repo *Repository `json:"repository,omitempty"` 1863 Sender *User `json:"sender,omitempty"` 1864 Installation *Installation `json:"installation,omitempty"` 1865 } 1866 1867 // SecurityAdvisory represents the advisory object in SecurityAdvisoryEvent payload. 1868 // 1869 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#security_advisory 1870 type SecurityAdvisory struct { 1871 CVSS *AdvisoryCVSS `json:"cvss,omitempty"` 1872 CWEs []*AdvisoryCWEs `json:"cwes,omitempty"` 1873 GHSAID *string `json:"ghsa_id,omitempty"` 1874 Summary *string `json:"summary,omitempty"` 1875 Description *string `json:"description,omitempty"` 1876 Severity *string `json:"severity,omitempty"` 1877 Identifiers []*AdvisoryIdentifier `json:"identifiers,omitempty"` 1878 References []*AdvisoryReference `json:"references,omitempty"` 1879 PublishedAt *Timestamp `json:"published_at,omitempty"` 1880 UpdatedAt *Timestamp `json:"updated_at,omitempty"` 1881 WithdrawnAt *Timestamp `json:"withdrawn_at,omitempty"` 1882 Vulnerabilities []*AdvisoryVulnerability `json:"vulnerabilities,omitempty"` 1883 CVEID *string `json:"cve_id,omitempty"` 1884 URL *string `json:"url,omitempty"` 1885 HTMLURL *string `json:"html_url,omitempty"` 1886 Author *User `json:"author,omitempty"` 1887 Publisher *User `json:"publisher,omitempty"` 1888 State *string `json:"state,omitempty"` 1889 CreatedAt *Timestamp `json:"created_at,omitempty"` 1890 ClosedAt *Timestamp `json:"closed_at,omitempty"` 1891 Submission *SecurityAdvisorySubmission `json:"submission,omitempty"` 1892 CWEIDs []string `json:"cwe_ids,omitempty"` 1893 Credits []*RepoAdvisoryCredit `json:"credits,omitempty"` 1894 CreditsDetailed []*RepoAdvisoryCreditDetailed `json:"credits_detailed,omitempty"` 1895 CollaboratingUsers []*User `json:"collaborating_users,omitempty"` 1896 CollaboratingTeams []*Team `json:"collaborating_teams,omitempty"` 1897 PrivateFork *Repository `json:"private_fork,omitempty"` 1898 } 1899 1900 // AdvisoryIdentifier represents the identifier for a Security Advisory. 1901 type AdvisoryIdentifier struct { 1902 Value *string `json:"value,omitempty"` 1903 Type *string `json:"type,omitempty"` 1904 } 1905 1906 // AdvisoryReference represents the reference url for the security advisory. 1907 type AdvisoryReference struct { 1908 URL *string `json:"url,omitempty"` 1909 } 1910 1911 // AdvisoryVulnerability represents the vulnerability object for a Security Advisory. 1912 type AdvisoryVulnerability struct { 1913 Package *VulnerabilityPackage `json:"package,omitempty"` 1914 Severity *string `json:"severity,omitempty"` 1915 VulnerableVersionRange *string `json:"vulnerable_version_range,omitempty"` 1916 FirstPatchedVersion *FirstPatchedVersion `json:"first_patched_version,omitempty"` 1917 1918 // PatchedVersions and VulnerableFunctions are used in the following APIs: 1919 // - https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories-for-an-organization 1920 // - https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories 1921 PatchedVersions *string `json:"patched_versions,omitempty"` 1922 VulnerableFunctions []string `json:"vulnerable_functions,omitempty"` 1923 } 1924 1925 // VulnerabilityPackage represents the package object for an Advisory Vulnerability. 1926 type VulnerabilityPackage struct { 1927 Ecosystem *string `json:"ecosystem,omitempty"` 1928 Name *string `json:"name,omitempty"` 1929 } 1930 1931 // FirstPatchedVersion represents the identifier for the first patched version of that vulnerability. 1932 type FirstPatchedVersion struct { 1933 Identifier *string `json:"identifier,omitempty"` 1934 } 1935 1936 // SecurityAdvisoryEvent is triggered when a security-related vulnerability is found in software on GitHub. 1937 // 1938 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#security_advisory 1939 type SecurityAdvisoryEvent struct { 1940 Action *string `json:"action,omitempty"` 1941 SecurityAdvisory *SecurityAdvisory `json:"security_advisory,omitempty"` 1942 1943 // The following fields are only populated by Webhook events. 1944 Enterprise *Enterprise `json:"enterprise,omitempty"` 1945 Installation *Installation `json:"installation,omitempty"` 1946 Organization *Organization `json:"organization,omitempty"` 1947 Repository *Repository `json:"repository,omitempty"` 1948 Sender *User `json:"sender,omitempty"` 1949 } 1950 1951 // CodeScanningAlertEvent is triggered when a code scanning finds a potential vulnerability or error in your code. 1952 // 1953 // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#code_scanning_alert 1954 type CodeScanningAlertEvent struct { 1955 Action *string `json:"action,omitempty"` 1956 Alert *Alert `json:"alert,omitempty"` 1957 Ref *string `json:"ref,omitempty"` 1958 // CommitOID is the commit SHA of the code scanning alert 1959 CommitOID *string `json:"commit_oid,omitempty"` 1960 Repo *Repository `json:"repository,omitempty"` 1961 Org *Organization `json:"organization,omitempty"` 1962 Sender *User `json:"sender,omitempty"` 1963 1964 Installation *Installation `json:"installation,omitempty"` 1965 } 1966 1967 // SponsorshipEvent represents a sponsorship event in GitHub. 1968 // 1969 // GitHub API docs: https://docs.github.com/en/rest/overview/github-event-types?apiVersion=2022-11-28#sponsorshipevent 1970 type SponsorshipEvent struct { 1971 Action *string `json:"action,omitempty"` 1972 EffectiveDate *string `json:"effective_date,omitempty"` 1973 Changes *SponsorshipChanges `json:"changes,omitempty"` 1974 Repository *Repository `json:"repository,omitempty"` 1975 Organization *Organization `json:"organization,omitempty"` 1976 Sender *User `json:"sender,omitempty"` 1977 Installation *Installation `json:"installation,omitempty"` 1978 } 1979 1980 // SponsorshipChanges represents changes made to the sponsorship. 1981 type SponsorshipChanges struct { 1982 Tier *SponsorshipTier `json:"tier,omitempty"` 1983 PrivacyLevel *string `json:"privacy_level,omitempty"` 1984 } 1985 1986 // SponsorshipTier represents the tier information of a sponsorship. 1987 type SponsorshipTier struct { 1988 From *string `json:"from,omitempty"` 1989 }