From 1e5c9cfc97775d8a87f1da0078e8fb49336dcd14 Mon Sep 17 00:00:00 2001 From: Aurimas Salamachinas Date: Thu, 27 Apr 2023 14:43:55 +0300 Subject: [PATCH] Add Repository field to DependabotAlert (#2769) --- github/dependabot_alerts.go | 1 + github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 7 +++++++ 3 files changed, 16 insertions(+) diff --git a/github/dependabot_alerts.go b/github/dependabot_alerts.go index e00aebc804f..7b5d53b3939 100644 --- a/github/dependabot_alerts.go +++ b/github/dependabot_alerts.go @@ -62,6 +62,7 @@ type DependabotAlert struct { DismissedReason *string `json:"dismissed_reason,omitempty"` DismissedComment *string `json:"dismissed_comment,omitempty"` FixedAt *Timestamp `json:"fixed_at,omitempty"` + Repository *Repository `json:"repository,omitempty"` } // ListAlertsOptions specifies the optional parameters to the DependabotService.ListRepoAlerts diff --git a/github/github-accessors.go b/github/github-accessors.go index 2f40756f258..91743340536 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4246,6 +4246,14 @@ func (d *DependabotAlert) GetNumber() int { return *d.Number } +// GetRepository returns the Repository field. +func (d *DependabotAlert) GetRepository() *Repository { + if d == nil { + return nil + } + return d.Repository +} + // GetSecurityAdvisory returns the SecurityAdvisory field. func (d *DependabotAlert) GetSecurityAdvisory() *DependabotSecurityAdvisory { if d == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 0a5d3a6e69c..8f7292d7b04 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -4984,6 +4984,13 @@ func TestDependabotAlert_GetNumber(tt *testing.T) { d.GetNumber() } +func TestDependabotAlert_GetRepository(tt *testing.T) { + d := &DependabotAlert{} + d.GetRepository() + d = nil + d.GetRepository() +} + func TestDependabotAlert_GetSecurityAdvisory(tt *testing.T) { d := &DependabotAlert{} d.GetSecurityAdvisory()