@@ -215,66 +215,111 @@ type GollumEvent struct {
215215// EditChange represents the changes when an issue, pull request, or comment has
216216// been edited.
217217type EditChange struct {
218- Title * struct {
219- From * string `json:"from,omitempty"`
220- } `json:"title,omitempty"`
221- Body * struct {
222- From * string `json:"from,omitempty"`
223- } `json:"body,omitempty"`
224- Base * struct {
225- Ref * struct {
226- From * string `json:"from,omitempty"`
227- } `json:"ref,omitempty"`
228- SHA * struct {
229- From * string `json:"from,omitempty"`
230- } `json:"sha,omitempty"`
231- } `json:"base,omitempty"`
218+ Title * EditTitle `json:"title,omitempty"`
219+ Body * EditBody `json:"body,omitempty"`
220+ Base * EditBase `json:"base,omitempty"`
221+ }
222+
223+ // EditTitle represents a pull-request title change.
224+ type EditTitle struct {
225+ From * string `json:"from,omitempty"`
226+ }
227+
228+ // EditBody represents a change of pull-request body.
229+ type EditBody struct {
230+ From * string `json:"from,omitempty"`
231+ }
232+
233+ // EditBase represents the change of a pull-request base branch.
234+ type EditBase struct {
235+ Ref * EditRef `json:"ref,omitempty"`
236+ SHA * EditSHA `json:"sha,omitempty"`
237+ }
238+
239+ // EditRef represents a ref change of a pull-request.
240+ type EditRef struct {
241+ From * string `json:"from,omitempty"`
242+ }
243+
244+ // EditSHA represents a sha change of a pull-request.
245+ type EditSHA struct {
246+ From * string `json:"from,omitempty"`
232247}
233248
234249// ProjectChange represents the changes when a project has been edited.
235250type ProjectChange struct {
236- Name * struct {
237- From * string `json:"from,omitempty"`
238- } `json:"name,omitempty"`
239- Body * struct {
240- From * string `json:"from,omitempty"`
241- } `json:"body,omitempty"`
251+ Name * ProjectName `json:"name,omitempty"`
252+ Body * ProjectBody `json:"body,omitempty"`
253+ }
254+
255+ // ProjectName represents a project name change.
256+ type ProjectName struct {
257+ From * string `json:"from,omitempty"`
258+ }
259+
260+ // ProjectBody represents a project body change.
261+ type ProjectBody struct {
262+ From * string `json:"from,omitempty"`
242263}
243264
244265// ProjectCardChange represents the changes when a project card has been edited.
245266type ProjectCardChange struct {
246- Note * struct {
247- From * string `json:"from,omitempty"`
248- } `json:"note,omitempty"`
267+ Note * ProjectCardNote `json:"note,omitempty"`
268+ }
269+
270+ // ProjectCardNote represents a change of a note of a project card.
271+ type ProjectCardNote struct {
272+ From * string `json:"from,omitempty"`
249273}
250274
251275// ProjectColumnChange represents the changes when a project column has been edited.
252276type ProjectColumnChange struct {
253- Name * struct {
254- From * string `json:"from,omitempty"`
255- } `json:"name,omitempty"`
277+ Name * ProjectColumnName `json:"name,omitempty"`
278+ }
279+
280+ // ProjectColumnName represents a project column name change.
281+ type ProjectColumnName struct {
282+ From * string `json:"from,omitempty"`
256283}
257284
258285// TeamChange represents the changes when a team has been edited.
259286type TeamChange struct {
260- Description * struct {
261- From * string `json:"from,omitempty"`
262- } `json:"description,omitempty"`
263- Name * struct {
264- From * string `json:"from,omitempty"`
265- } `json:"name,omitempty"`
266- Privacy * struct {
267- From * string `json:"from,omitempty"`
268- } `json:"privacy,omitempty"`
269- Repository * struct {
270- Permissions * struct {
271- From * struct {
272- Admin * bool `json:"admin,omitempty"`
273- Pull * bool `json:"pull,omitempty"`
274- Push * bool `json:"push,omitempty"`
275- } `json:"from,omitempty"`
276- } `json:"permissions,omitempty"`
277- } `json:"repository,omitempty"`
287+ Description * TeamDescription `json:"description,omitempty"`
288+ Name * TeamName `json:"name,omitempty"`
289+ Privacy * TeamPrivacy `json:"privacy,omitempty"`
290+ Repository * TeamRepository `json:"repository,omitempty"`
291+ }
292+
293+ // TeamDescription represents a team description change.
294+ type TeamDescription struct {
295+ From * string `json:"from,omitempty"`
296+ }
297+
298+ // TeamName represents a team name change.
299+ type TeamName struct {
300+ From * string `json:"from,omitempty"`
301+ }
302+
303+ // TeamPrivacy represents a team privacy change.
304+ type TeamPrivacy struct {
305+ From * string `json:"from,omitempty"`
306+ }
307+
308+ // TeamRepository represents a team repository permission change.
309+ type TeamRepository struct {
310+ Permissions * TeamPermissions `json:"permissions,omitempty"`
311+ }
312+
313+ // TeamPermissions represents a team permission change.
314+ type TeamPermissions struct {
315+ From * TeamPermissionsFrom `json:"from,omitempty"`
316+ }
317+
318+ // TeamPermissionsFrom represents a team permission change.
319+ type TeamPermissionsFrom struct {
320+ Admin * bool `json:"admin,omitempty"`
321+ Pull * bool `json:"pull,omitempty"`
322+ Push * bool `json:"push,omitempty"`
278323}
279324
280325// InstallationEvent is triggered when a GitHub App has been installed, uninstalled, suspend, unsuspended
@@ -890,25 +935,28 @@ type RepositoryVulnerabilityAlertEvent struct {
890935 Action * string `json:"action,omitempty"`
891936
892937 //The security alert of the vulnerable dependency.
893- Alert * struct {
894- ID * int64 `json:"id,omitempty"`
895- AffectedRange * string `json:"affected_range,omitempty"`
896- AffectedPackageName * string `json:"affected_package_name,omitempty"`
897- ExternalReference * string `json:"external_reference,omitempty"`
898- ExternalIdentifier * string `json:"external_identifier,omitempty"`
899- GitHubSecurityAdvisoryID * string `json:"ghsa_id,omitempty"`
900- Severity * string `json:"severity,omitempty"`
901- CreatedAt * Timestamp `json:"created_at,omitempty"`
902- FixedIn * string `json:"fixed_in,omitempty"`
903- Dismisser * User `json:"dismisser,omitempty"`
904- DismissReason * string `json:"dismiss_reason,omitempty"`
905- DismissedAt * Timestamp `json:"dismissed_at,omitempty"`
906- } `json:"alert,omitempty"`
938+ Alert * RepositoryVulnerabilityAlert `json:"alert,omitempty"`
907939
908940 //The repository of the vulnerable dependency.
909941 Repository * Repository `json:"repository,omitempty"`
910942}
911943
944+ // RepositoryVulnerabilityAlert represents a repository security alert.
945+ type RepositoryVulnerabilityAlert struct {
946+ ID * int64 `json:"id,omitempty"`
947+ AffectedRange * string `json:"affected_range,omitempty"`
948+ AffectedPackageName * string `json:"affected_package_name,omitempty"`
949+ ExternalReference * string `json:"external_reference,omitempty"`
950+ ExternalIdentifier * string `json:"external_identifier,omitempty"`
951+ GitHubSecurityAdvisoryID * string `json:"ghsa_id,omitempty"`
952+ Severity * string `json:"severity,omitempty"`
953+ CreatedAt * Timestamp `json:"created_at,omitempty"`
954+ FixedIn * string `json:"fixed_in,omitempty"`
955+ Dismisser * User `json:"dismisser,omitempty"`
956+ DismissReason * string `json:"dismiss_reason,omitempty"`
957+ DismissedAt * Timestamp `json:"dismissed_at,omitempty"`
958+ }
959+
912960// StarEvent is triggered when a star is added or removed from a repository.
913961// The Webhook event name is "star".
914962//
0 commit comments