Skip to content

Commit

Permalink
feat: Add custom_property events (#3379)
Browse files Browse the repository at this point in the history
Fixes: #3207.
  • Loading branch information
acouvreur authored Dec 10, 2024
1 parent 077cefe commit f349af0
Show file tree
Hide file tree
Showing 8 changed files with 762 additions and 1 deletion.
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 <[email protected]>
Alex Unger <[email protected]>
Alexander Harkness <[email protected]>
Alexey Alekhin <[email protected]>
Alexis Couvreur <[email protected]>
Alexis Gauthiez <[email protected]>
Ali Farooq <[email protected]>
Alin Balutoiu <[email protected]>
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

0 comments on commit f349af0

Please sign in to comment.