Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add support for dependabot_alert webhook event #2888

Merged
merged 2 commits into from Aug 29, 2023

Conversation

nikpivkin
Copy link
Contributor

Closes #2790

Added support for dependabot_alert webhook event.

@codecov
Copy link

codecov bot commented Aug 20, 2023

Codecov Report

Merging #2888 (55430bc) into master (a0e8f35) will not change coverage.
Report is 2 commits behind head on master.
The diff coverage is n/a.

❗ Current head 55430bc differs from pull request most recent head 5851a0e. Consider uploading reports for the commit 5851a0e to get more accurate results

@@           Coverage Diff           @@
##           master    #2888   +/-   ##
=======================================
  Coverage   98.06%   98.06%           
=======================================
  Files         140      140           
  Lines       12269    12269           
=======================================
  Hits        12031    12031           
  Misses        162      162           
  Partials       76       76           
Files Changed Coverage Δ
github/dependabot_alerts.go 100.00% <ø> (ø)
github/event_types.go 100.00% <ø> (ø)
github/messages.go 100.00% <ø> (ø)

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @nikpivkin !

// GitHub API docs: https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#dependabot_alert
type DependabotAlertEvent struct {
Action *string `json:"action,omitempty"`
Alert DependabotAlert `json:"alert"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Alert DependabotAlert `json:"alert"`
Alert *DependabotAlert `json:"alert,omitempty"`

Comment on lines 145 to 150
// The following field is only present when the webhook is triggered on
Installation *Installation `json:"installation,omitempty"`
Organization *Organization `json:"organization,omitempty"`
Enterprise *Enterprise `json:"enterprise,omitempty"`
Repo *Repository `json:"repository,omitempty"`
Sender *User `json:"sender,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// The following field is only present when the webhook is triggered on
Installation *Installation `json:"installation,omitempty"`
Organization *Organization `json:"organization,omitempty"`
Enterprise *Enterprise `json:"enterprise,omitempty"`
Repo *Repository `json:"repository,omitempty"`
Sender *User `json:"sender,omitempty"`
// The following fields are only populated by Webhook events.
Installation *Installation `json:"installation,omitempty"`
Enterprise *Enterprise `json:"enterprise,omitempty"`
Repo *Repository `json:"repository,omitempty"`
Sender *User `json:"sender,omitempty"`
// The following field is only present when the webhook is triggered on
// a repository belonging to an organization.
Organization *Organization `json:"organization,omitempty"`

@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Aug 21, 2023
Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @nikpivkin !
LGTM.

Awaiting second LGTM+Approval from any other contributor to this repo before merging.

@gmlewis
Copy link
Collaborator

gmlewis commented Aug 29, 2023

Thank you, @WillAbides !
Merging.

@gmlewis gmlewis removed the NeedsReview PR is awaiting a review before merging. label Aug 29, 2023
@gmlewis gmlewis merged commit 8596515 into google:master Aug 29, 2023
7 checks passed
gmlewis pushed a commit to gmlewis/go-github that referenced this pull request Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dependabot_alert Event missing in eventTypeMapping
3 participants