diff --git a/github/code-scanning.go b/github/code-scanning.go index f05420829e..53200fa3ee 100644 --- a/github/code-scanning.go +++ b/github/code-scanning.go @@ -87,6 +87,7 @@ type Alert struct { DismissedBy *User `json:"dismissed_by,omitempty"` DismissedAt *Timestamp `json:"dismissed_at,omitempty"` DismissedReason *string `json:"dismissed_reason,omitempty"` + DismissedComment *string `json:"dismissed_comment,omitempty"` InstancesURL *string `json:"instances_url,omitempty"` } diff --git a/github/github-accessors.go b/github/github-accessors.go index 3f510b9ec1..ca558f6395 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -302,6 +302,14 @@ func (a *Alert) GetDismissedBy() *User { return a.DismissedBy } +// GetDismissedComment returns the DismissedComment field if it's non-nil, zero value otherwise. +func (a *Alert) GetDismissedComment() string { + if a == nil || a.DismissedComment == nil { + return "" + } + return *a.DismissedComment +} + // GetDismissedReason returns the DismissedReason field if it's non-nil, zero value otherwise. func (a *Alert) GetDismissedReason() string { if a == nil || a.DismissedReason == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 0a3d0ed18b..7cc7834acb 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -333,6 +333,16 @@ func TestAlert_GetDismissedBy(tt *testing.T) { a.GetDismissedBy() } +func TestAlert_GetDismissedComment(tt *testing.T) { + var zeroValue string + a := &Alert{DismissedComment: &zeroValue} + a.GetDismissedComment() + a = &Alert{} + a.GetDismissedComment() + a = nil + a.GetDismissedComment() +} + func TestAlert_GetDismissedReason(tt *testing.T) { var zeroValue string a := &Alert{DismissedReason: &zeroValue}