Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: Add custom_property events #3379

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Alex Su <alexsu@17.media>
Alex Unger <zyxancf@gmail.com>
Alexander Harkness <me@bearbin.net>
Alexey Alekhin <laughedelic@gmail.com>
Alexis Couvreur <alexiscouvreur.pro@gmail.com>
Alexis Gauthiez <alexis.gauthiez@gmail.com>
Ali Farooq <ali.farooq0@pm.me>
Alin Balutoiu <alinbalutoiu@gmail.com>
Expand Down
37 changes: 37 additions & 0 deletions github/event_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,43 @@ type CreateEvent struct {
Installation *Installation `json:"installation,omitempty"`
}

// CustomPropertyEvent represents a created, deleted or updated custom property.
// The Webhook event name is "custom_property".
//
// Note: this is related to custom property configuration at the enterprise or organization level.
// See CustomPropertyValuesEvent for activity related to custom property values for a repository.
//
// GitHub API docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#custom_property
type CustomPropertyEvent struct {
// Action possible values are: "created", "deleted", "updated".
Action *string `json:"action,omitempty"`
Definition *CustomProperty `json:"definition,omitempty"`

// The following fields are only populated by Webhook events.
Enterprise *Enterprise `json:"enterprise,omitempty"`
Installation *Installation `json:"installation,omitempty"`
Org *Organization `json:"organization,omitempty"`
Sender *User `json:"sender,omitempty"`
}

// CustomPropertyValuesEvent represents an update to a custom property.
// The Webhook event name is "custom_property_values".
//
// GitHub API docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#custom_property_values
type CustomPropertyValuesEvent struct {
// Action possible values are: "updated".
Action *string `json:"action,omitempty"`
NewPropertyValues []*CustomPropertyValue `json:"new_property_values,omitempty"`
OldPropertyValues []*CustomPropertyValue `json:"old_property_values,omitempty"`

// The following fields are only populated by Webhook events.
Enterprise *Enterprise `json:"enterprise,omitempty"`
Installation *Installation `json:"installation,omitempty"`
Repo *Repository `json:"repository,omitempty"`
Org *Organization `json:"organization,omitempty"`
Sender *User `json:"sender,omitempty"`
}

// DeleteEvent represents a deleted branch or tag.
// The Webhook event name is "delete".
//
Expand Down
Loading
Loading