From 3f18ff38c9ba75d307dd4def2a88610450b02f6e Mon Sep 17 00:00:00 2001 From: Bingtan Lu Date: Tue, 27 Dec 2022 23:44:25 +0800 Subject: [PATCH] Add installation in CodeScanningAlertEvent type. Signed-off-by: Bingtan Lu --- github/event_types.go | 2 ++ github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/github/event_types.go b/github/event_types.go index 6c59b7b532..8330353a3c 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -1389,4 +1389,6 @@ type CodeScanningAlertEvent struct { Repo *Repository `json:"repository,omitempty"` Org *Organization `json:"organization,omitempty"` Sender *User `json:"sender,omitempty"` + + Installation *Installation `json:"installation,omitempty"` } diff --git a/github/github-accessors.go b/github/github-accessors.go index 8a7a599670..422d8bc0d3 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -2454,6 +2454,14 @@ func (c *CodeScanningAlertEvent) GetCommitOID() string { return *c.CommitOID } +// GetInstallation returns the Installation field. +func (c *CodeScanningAlertEvent) GetInstallation() *Installation { + if c == nil { + return nil + } + return c.Installation +} + // GetOrg returns the Org field. func (c *CodeScanningAlertEvent) GetOrg() *Organization { if c == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index deb33dc9fe..efa66e7875 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -2900,6 +2900,13 @@ func TestCodeScanningAlertEvent_GetCommitOID(tt *testing.T) { c.GetCommitOID() } +func TestCodeScanningAlertEvent_GetInstallation(tt *testing.T) { + c := &CodeScanningAlertEvent{} + c.GetInstallation() + c = nil + c.GetInstallation() +} + func TestCodeScanningAlertEvent_GetOrg(tt *testing.T) { c := &CodeScanningAlertEvent{} c.GetOrg()