Repository: google/go-github
Pull request #3548 (2025-04-14 18:25:26)

feat: Add new fields and options to secret scanning structs
Added some new fields to secret scanning alerts

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/google/go-github/pull/3548?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 91.23%. Comparing base [(`3a3f51b`)](https://app.codecov.io/gh/google/go-github/commit/3a3f51bc7c5daa18f7da89d1f806f200fcd4ce96?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) to head [(`eff6f4b`)](https://app.codecov.io/gh/google/go-github/commit/eff6f4b4ebc883fd9e9ece3aa7b4b6145033df5c?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google).
> Report is 8 commits behind head on master.

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##           master    #3548      +/-   ##
==========================================
- Coverage   91.29%   91.23%   -0.07%     
==========================================
  Files         184      183       -1     
  Lines       16169    16053     -116     
==========================================
- Hits        14762    14646     -116     
  Misses       1231     1231              
  Partials      176      176              
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/google/go-github/pull/3548?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google).

<details><summary> :rocket: New features to boost your workflow: </summary>

- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>
gmlewis: Please run:
* `./script/fmt.sh`
* `./script/generate.sh`
and push the changes to this PR, then we should be good to go.
mdfleury-wbd: The broken tests seem to be coming from https://github.com/google/go-github/pull/3551
which is here
https://github.com/codecov/codecov-action/compare/v5.4.0..v5.4.2
gmlewis: > The broken tests seem to be coming from #3551 which is here https://github.com/codecov/codecov-action/compare/v5.4.0..v5.4.2

Thank you, @mdfleury-wbd!
I've reverted that change.  Would you mind merging the latest master branch into this PR to see if that fixes the problem?
gmlewis: Oh wait, I forgot that I can do that... one moment...
gmlewis: That fixed it!  Woohoo!

Patch:
diff --git a/github/github-accessors.go b/github/github-accessors.go
index 4a327027..8530cd91 100644
--- a/github/github-accessors.go
+++ b/github/github-accessors.go
@@ -24686,6 +24686,14 @@ func (s *SecretScanningAlert) GetHTMLURL() string {
 	return *s.HTMLURL
 }
 
+// GetIsBase64Encoded returns the IsBase64Encoded field if it's non-nil, zero value otherwise.
+func (s *SecretScanningAlert) GetIsBase64Encoded() bool {
+	if s == nil || s.IsBase64Encoded == nil {
+		return false
+	}
+	return *s.IsBase64Encoded
+}
+
 // GetLocationsURL returns the LocationsURL field if it's non-nil, zero value otherwise.
 func (s *SecretScanningAlert) GetLocationsURL() string {
 	if s == nil || s.LocationsURL == nil {
@@ -24694,6 +24702,14 @@ func (s *SecretScanningAlert) GetLocationsURL() string {
 	return *s.LocationsURL
 }
 
+// GetMultiRepo returns the MultiRepo field if it's non-nil, zero value otherwise.
+func (s *SecretScanningAlert) GetMultiRepo() bool {
+	if s == nil || s.MultiRepo == nil {
+		return false
+	}
+	return *s.MultiRepo
+}
+
 // GetNumber returns the Number field if it's non-nil, zero value otherwise.
 func (s *SecretScanningAlert) GetNumber() int {
 	if s == nil || s.Number == nil {
@@ -24702,6 +24718,14 @@ func (s *SecretScanningAlert) GetNumber() int {
 	return *s.Number
 }
 
+// GetPubliclyLeaked returns the PubliclyLeaked field if it's non-nil, zero value otherwise.
+func (s *SecretScanningAlert) GetPubliclyLeaked() bool {
+	if s == nil || s.PubliclyLeaked == nil {
+		return false
+	}
+	return *s.PubliclyLeaked
+}
+
 // GetPushProtectionBypassed returns the PushProtectionBypassed field if it's non-nil, zero value otherwise.
 func (s *SecretScanningAlert) GetPushProtectionBypassed() bool {
 	if s == nil || s.PushProtectionBypassed == nil {
@@ -24726,6 +24750,38 @@ func (s *SecretScanningAlert) GetPushProtectionBypassedBy() *User {
 	return s.PushProtectionBypassedBy
 }
 
+// GetPushProtectionBypassRequestComment returns the PushProtectionBypassRequestComment field if it's non-nil, zero value otherwise.
+func (s *SecretScanningAlert) GetPushProtectionBypassRequestComment() string {
+	if s == nil || s.PushProtectionBypassRequestComment == nil {
+		return ""
+	}
+	return *s.PushProtectionBypassRequestComment
+}
+
+// GetPushProtectionBypassRequestHTMLURL returns the PushProtectionBypassRequestHTMLURL field if it's non-nil, zero value otherwise.
+func (s *SecretScanningAlert) GetPushProtectionBypassRequestHTMLURL() string {
+	if s == nil || s.PushProtectionBypassRequestHTMLURL == nil {
+		return ""
+	}
+	return *s.PushProtectionBypassRequestHTMLURL
+}
+
+// GetPushProtectionBypassRequestReviewer returns the PushProtectionBypassRequestReviewer field.
+func (s *SecretScanningAlert) GetPushProtectionBypassRequestReviewer() *User {
+	if s == nil {
+		return nil
+	}
+	return s.PushProtectionBypassRequestReviewer
+}
+
+// GetPushProtectionBypassRequestReviewerComment returns the PushProtectionBypassRequestReviewerComment field if it's non-nil, zero value otherwise.
+func (s *SecretScanningAlert) GetPushProtectionBypassRequestReviewerComment() string {
+	if s == nil || s.PushProtectionBypassRequestReviewerComment == nil {
+		return ""
+	}
+	return *s.PushProtectionBypassRequestReviewerComment
+}
+
 // GetRepository returns the Repository field.
 func (s *SecretScanningAlert) GetRepository() *Repository {
 	if s == nil {
@@ -24814,6 +24870,14 @@ func (s *SecretScanningAlert) GetURL() string {
 	return *s.URL
 }
 
+// GetValidity returns the Validity field if it's non-nil, zero value otherwise.
+func (s *SecretScanningAlert) GetValidity() string {
+	if s == nil || s.Validity == nil {
+		return ""
+	}
+	return *s.Validity
+}
+
 // GetAction returns the Action field if it's non-nil, zero value otherwise.
 func (s *SecretScanningAlertEvent) GetAction() string {
 	if s == nil || s.Action == nil {
diff --git a/github/secret_scanning.go b/github/secret_scanning.go
index 4eeeba3d..ad2312d0 100644
--- a/github/secret_scanning.go
+++ b/github/secret_scanning.go
@@ -16,24 +16,32 @@ type SecretScanningService service
 
 // SecretScanningAlert represents a GitHub secret scanning alert.
 type SecretScanningAlert struct {
-	Number                   *int        `json:"number,omitempty"`
-	CreatedAt                *Timestamp  `json:"created_at,omitempty"`
-	URL                      *string     `json:"url,omitempty"`
-	HTMLURL                  *string     `json:"html_url,omitempty"`
-	LocationsURL             *string     `json:"locations_url,omitempty"`
-	State                    *string     `json:"state,omitempty"`
-	Resolution               *string     `json:"resolution,omitempty"`
-	ResolvedAt               *Timestamp  `json:"resolved_at,omitempty"`
-	ResolvedBy               *User       `json:"resolved_by,omitempty"`
-	SecretType               *string     `json:"secret_type,omitempty"`
-	SecretTypeDisplayName    *string     `json:"secret_type_display_name,omitempty"`
-	Secret                   *string     `json:"secret,omitempty"`
-	Repository               *Repository `json:"repository,omitempty"`
-	UpdatedAt                *Timestamp  `json:"updated_at,omitempty"`
-	PushProtectionBypassed   *bool       `json:"push_protection_bypassed,omitempty"`
-	PushProtectionBypassedBy *User       `json:"push_protection_bypassed_by,omitempty"`
-	PushProtectionBypassedAt *Timestamp  `json:"push_protection_bypassed_at,omitempty"`
-	ResolutionComment        *string     `json:"resolution_comment,omitempty"`
+	Number                                     *int        `json:"number,omitempty"`
+	CreatedAt                                  *Timestamp  `json:"created_at,omitempty"`
+	URL                                        *string     `json:"url,omitempty"`
+	HTMLURL                                    *string     `json:"html_url,omitempty"`
+	LocationsURL                               *string     `json:"locations_url,omitempty"`
+	State                                      *string     `json:"state,omitempty"`
+	Resolution                                 *string     `json:"resolution,omitempty"`
+	ResolvedAt                                 *Timestamp  `json:"resolved_at,omitempty"`
+	ResolvedBy                                 *User       `json:"resolved_by,omitempty"`
+	SecretType                                 *string     `json:"secret_type,omitempty"`
+	SecretTypeDisplayName                      *string     `json:"secret_type_display_name,omitempty"`
+	Secret                                     *string     `json:"secret,omitempty"`
+	Repository                                 *Repository `json:"repository,omitempty"`
+	UpdatedAt                                  *Timestamp  `json:"updated_at,omitempty"`
+	IsBase64Encoded                            *bool       `json:"is_base64_encoded,omitempty"`
+	MultiRepo                                  *bool       `json:"multi_repo,omitempty"`
+	PubliclyLeaked                             *bool       `json:"publicly_leaked,omitempty"`
+	PushProtectionBypassed                     *bool       `json:"push_protection_bypassed,omitempty"`
+	PushProtectionBypassedBy                   *User       `json:"push_protection_bypassed_by,omitempty"`
+	PushProtectionBypassedAt                   *Timestamp  `json:"push_protection_bypassed_at,omitempty"`
+	ResolutionComment                          *string     `json:"resolution_comment,omitempty"`
+	PushProtectionBypassRequestComment         *string     `json:"push_protection_bypass_request_comment,omitempty"`
+	PushProtectionBypassRequestHTMLURL         *string     `json:"push_protection_bypass_request_html_url,omitempty"`
+	PushProtectionBypassRequestReviewer        *User       `json:"push_protection_bypass_request_reviewer,omitempty"`
+	PushProtectionBypassRequestReviewerComment *string     `json:"push_protection_bypass_request_reviewer_comment,omitempty"`
+	Validity                                   *string     `json:"validity,omitempty"`
 }
 
 // SecretScanningAlertLocation represents the location for a secret scanning alert.
@@ -72,6 +80,12 @@ type SecretScanningAlertListOptions struct {
 	// Valid options are active, inactive, and unknown.
 	Validity string `url:"validity,omitempty"`
 
+	// A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. Default: false.
+	IsPubliclyLeaked bool `url:"is_publicly_leaked,omitempty"`
+
+	// A boolean value representing whether or not to filter alerts by the multi-repo tag being present. Default: false.
+	IsMultiRepo bool `url:"is_multi_repo,omitempty"`
+
 	// The direction to sort the results by. Possible values are: asc, desc. Default: desc.
 	Direction string `url:"direction,omitempty"`
 


Test patch:
diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go
index 9efb190b..8b85e063 100644
--- a/github/github-accessors_test.go
+++ b/github/github-accessors_test.go
@@ -31785,6 +31785,17 @@ func TestSecretScanningAlert_GetHTMLURL(tt *testing.T) {
 	s.GetHTMLURL()
 }
 
+func TestSecretScanningAlert_GetIsBase64Encoded(tt *testing.T) {
+	tt.Parallel()
+	var zeroValue bool
+	s := &SecretScanningAlert{IsBase64Encoded: &zeroValue}
+	s.GetIsBase64Encoded()
+	s = &SecretScanningAlert{}
+	s.GetIsBase64Encoded()
+	s = nil
+	s.GetIsBase64Encoded()
+}
+
 func TestSecretScanningAlert_GetLocationsURL(tt *testing.T) {
 	tt.Parallel()
 	var zeroValue string
@@ -31796,6 +31807,17 @@ func TestSecretScanningAlert_GetLocationsURL(tt *testing.T) {
 	s.GetLocationsURL()
 }
 
+func TestSecretScanningAlert_GetMultiRepo(tt *testing.T) {
+	tt.Parallel()
+	var zeroValue bool
+	s := &SecretScanningAlert{MultiRepo: &zeroValue}
+	s.GetMultiRepo()
+	s = &SecretScanningAlert{}
+	s.GetMultiRepo()
+	s = nil
+	s.GetMultiRepo()
+}
+
 func TestSecretScanningAlert_GetNumber(tt *testing.T) {
 	tt.Parallel()
 	var zeroValue int
@@ -31807,6 +31829,17 @@ func TestSecretScanningAlert_GetNumber(tt *testing.T) {
 	s.GetNumber()
 }
 
+func TestSecretScanningAlert_GetPubliclyLeaked(tt *testing.T) {
+	tt.Parallel()
+	var zeroValue bool
+	s := &SecretScanningAlert{PubliclyLeaked: &zeroValue}
+	s.GetPubliclyLeaked()
+	s = &SecretScanningAlert{}
+	s.GetPubliclyLeaked()
+	s = nil
+	s.GetPubliclyLeaked()
+}
+
 func TestSecretScanningAlert_GetPushProtectionBypassed(tt *testing.T) {
 	tt.Parallel()
 	var zeroValue bool
@@ -31837,6 +31870,47 @@ func TestSecretScanningAlert_GetPushProtectionBypassedBy(tt *testing.T) {
 	s.GetPushProtectionBypassedBy()
 }
 
+func TestSecretScanningAlert_GetPushProtectionBypassRequestComment(tt *testing.T) {
+	tt.Parallel()
+	var zeroValue string
+	s := &SecretScanningAlert{PushProtectionBypassRequestComment: &zeroValue}
+	s.GetPushProtectionBypassRequestComment()
+	s = &SecretScanningAlert{}
+	s.GetPushProtectionBypassRequestComment()
+	s = nil
+	s.GetPushProtectionBypassRequestComment()
+}
+
+func TestSecretScanningAlert_GetPushProtectionBypassRequestHTMLURL(tt *testing.T) {
+	tt.Parallel()
+	var zeroValue string
+	s := &SecretScanningAlert{PushProtectionBypassRequestHTMLURL: &zeroValue}
+	s.GetPushProtectionBypassRequestHTMLURL()
+	s = &SecretScanningAlert{}
+	s.GetPushProtectionBypassRequestHTMLURL()
+	s = nil
+	s.GetPushProtectionBypassRequestHTMLURL()
+}
+
+func TestSecretScanningAlert_GetPushProtectionBypassRequestReviewer(tt *testing.T) {
+	tt.Parallel()
+	s := &SecretScanningAlert{}
+	s.GetPushProtectionBypassRequestReviewer()
+	s = nil
+	s.GetPushProtectionBypassRequestReviewer()
+}
+
+func TestSecretScanningAlert_GetPushProtectionBypassRequestReviewerComment(tt *testing.T) {
+	tt.Parallel()
+	var zeroValue string
+	s := &SecretScanningAlert{PushProtectionBypassRequestReviewerComment: &zeroValue}
+	s.GetPushProtectionBypassRequestReviewerComment()
+	s = &SecretScanningAlert{}
+	s.GetPushProtectionBypassRequestReviewerComment()
+	s = nil
+	s.GetPushProtectionBypassRequestReviewerComment()
+}
+
 func TestSecretScanningAlert_GetRepository(tt *testing.T) {
 	tt.Parallel()
 	s := &SecretScanningAlert{}
@@ -31952,6 +32026,17 @@ func TestSecretScanningAlert_GetURL(tt *testing.T) {
 	s.GetURL()
 }
 
+func TestSecretScanningAlert_GetValidity(tt *testing.T) {
+	tt.Parallel()
+	var zeroValue string
+	s := &SecretScanningAlert{Validity: &zeroValue}
+	s.GetValidity()
+	s = &SecretScanningAlert{}
+	s.GetValidity()
+	s = nil
+	s.GetValidity()
+}
+
 func TestSecretScanningAlertEvent_GetAction(tt *testing.T) {
 	tt.Parallel()
 	var zeroValue string