Skip to content

Commit 5851a0e

Browse files
committed
fix event
1 parent 55430bc commit 5851a0e

4 files changed

Lines changed: 23 additions & 5 deletions

File tree

github/event_types.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,18 @@ type DeleteEvent struct {
139139
//
140140
// GitHub API docs: https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#dependabot_alert
141141
type DependabotAlertEvent struct {
142-
Action *string `json:"action,omitempty"`
143-
Alert DependabotAlert `json:"alert"`
142+
Action *string `json:"action,omitempty"`
143+
Alert *DependabotAlert `json:"alert,omitempty"`
144144

145-
// The following field is only present when the webhook is triggered on
145+
// The following fields are only populated by Webhook events.
146146
Installation *Installation `json:"installation,omitempty"`
147-
Organization *Organization `json:"organization,omitempty"`
148147
Enterprise *Enterprise `json:"enterprise,omitempty"`
149148
Repo *Repository `json:"repository,omitempty"`
150149
Sender *User `json:"sender,omitempty"`
150+
151+
// The following field is only present when the webhook is triggered on
152+
// a repository belonging to an organization.
153+
Organization *Organization `json:"organization,omitempty"`
151154
}
152155

153156
// DeployKeyEvent is triggered when a deploy key is added or removed from a repository.

github/event_types_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12705,7 +12705,7 @@ func TestDependabotAlertEvent_Marshal(t *testing.T) {
1270512705

1270612706
e := &DependabotAlertEvent{
1270712707
Action: String("a"),
12708-
Alert: DependabotAlert{
12708+
Alert: &DependabotAlert{
1270912709
Number: Int(1),
1271012710
State: String("s"),
1271112711
Dependency: &Dependency{

github/github-accessors.go

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/github-accessors_test.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)