Skip to content

Commit f349af0

Browse files
authored
feat: Add custom_property events (#3379)
Fixes: #3207.
1 parent 077cefe commit f349af0

8 files changed

+762
-1
lines changed

AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Alex Su <[email protected]>
4040
Alex Unger <[email protected]>
4141
Alexander Harkness <[email protected]>
4242
Alexey Alekhin <[email protected]>
43+
Alexis Couvreur <[email protected]>
4344
Alexis Gauthiez <[email protected]>
4445
Ali Farooq <[email protected]>
4546
Alin Balutoiu <[email protected]>

github/event_types.go

+37
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,43 @@ type CreateEvent struct {
132132
Installation *Installation `json:"installation,omitempty"`
133133
}
134134

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+
135172
// DeleteEvent represents a deleted branch or tag.
136173
// The Webhook event name is "delete".
137174
//

0 commit comments

Comments
 (0)