From dd2e971bacee10d27f1a79303ec2234069bb56a8 Mon Sep 17 00:00:00 2001 From: tomasz-adam-skrzypczak Date: Mon, 11 Dec 2023 13:24:53 +0100 Subject: [PATCH 1/6] feat: add secret scanning validity checks to repos --- github/github-accessors.go | 16 ++++++++++++++++ github/github-accessors_test.go | 17 +++++++++++++++++ github/github-stringify_test.go | 13 ++++++++++++- github/repos.go | 12 ++++++++++++ github/repos_test.go | 4 ++-- 5 files changed, 59 insertions(+), 3 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index e15eb10204b..a47ba28243c 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -21590,6 +21590,14 @@ func (s *SecretScanningPushProtection) GetStatus() string { return *s.Status } +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (s *SecretScanningValidityChecks) GetStatus() string { + if s == nil || s.Status == nil { + return "" + } + return *s.Status +} + // GetAuthor returns the Author field. func (s *SecurityAdvisory) GetAuthor() *User { if s == nil { @@ -21830,6 +21838,14 @@ func (s *SecurityAndAnalysis) GetSecretScanningPushProtection() *SecretScanningP return s.SecretScanningPushProtection } +// GetSecretScanningValidityChecks returns the SecretScanningValidityChecks field. +func (s *SecurityAndAnalysis) GetSecretScanningValidityChecks() *SecretScanningValidityChecks { + if s == nil { + return nil + } + return s.SecretScanningValidityChecks +} + // GetFrom returns the From field. func (s *SecurityAndAnalysisChange) GetFrom() *SecurityAndAnalysisChangeFrom { if s == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 84d104f18cb..bf1be2ded9e 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -25149,6 +25149,16 @@ func TestSecretScanningPushProtection_GetStatus(tt *testing.T) { s.GetStatus() } +func TestSecretScanningValidityChecks_GetStatus(tt *testing.T) { + var zeroValue string + s := &SecretScanningValidityChecks{Status: &zeroValue} + s.GetStatus() + s = &SecretScanningValidityChecks{} + s.GetStatus() + s = nil + s.GetStatus() +} + func TestSecurityAdvisory_GetAuthor(tt *testing.T) { s := &SecurityAdvisory{} s.GetAuthor() @@ -25404,6 +25414,13 @@ func TestSecurityAndAnalysis_GetSecretScanningPushProtection(tt *testing.T) { s.GetSecretScanningPushProtection() } +func TestSecurityAndAnalysis_GetSecretScanningValidityChecks(tt *testing.T) { + s := &SecurityAndAnalysis{} + s.GetSecretScanningValidityChecks() + s = nil + s.GetSecretScanningValidityChecks() +} + func TestSecurityAndAnalysisChange_GetFrom(tt *testing.T) { s := &SecurityAndAnalysisChange{} s.GetFrom() diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 7472edfd59a..03a016529ff 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1820,14 +1820,25 @@ func TestSecretScanningPushProtection_String(t *testing.T) { } } +func TestSecretScanningValidityChecks_String(t *testing.T) { + v := SecretScanningValidityChecks{ + Status: String(""), + } + want := `github.SecretScanningValidityChecks{Status:""}` + if got := v.String(); got != want { + t.Errorf("SecretScanningValidityChecks.String = %v, want %v", got, want) + } +} + func TestSecurityAndAnalysis_String(t *testing.T) { v := SecurityAndAnalysis{ AdvancedSecurity: &AdvancedSecurity{}, SecretScanning: &SecretScanning{}, SecretScanningPushProtection: &SecretScanningPushProtection{}, DependabotSecurityUpdates: &DependabotSecurityUpdates{}, + SecretScanningValidityChecks: &SecretScanningValidityChecks{}, } - want := `github.SecurityAndAnalysis{AdvancedSecurity:github.AdvancedSecurity{}, SecretScanning:github.SecretScanning{}, SecretScanningPushProtection:github.SecretScanningPushProtection{}, DependabotSecurityUpdates:github.DependabotSecurityUpdates{}}` + want := `github.SecurityAndAnalysis{AdvancedSecurity:github.AdvancedSecurity{}, SecretScanning:github.SecretScanning{}, SecretScanningPushProtection:github.SecretScanningPushProtection{}, DependabotSecurityUpdates:github.DependabotSecurityUpdates{}, SecretScanningValidityChecks:github.SecretScanningValidityChecks{}}` if got := v.String(); got != want { t.Errorf("SecurityAndAnalysis.String = %v, want %v", got, want) } diff --git a/github/repos.go b/github/repos.go index 5fcf219b3cf..9c9a83e5ba2 100644 --- a/github/repos.go +++ b/github/repos.go @@ -198,6 +198,7 @@ type SecurityAndAnalysis struct { SecretScanning *SecretScanning `json:"secret_scanning,omitempty"` SecretScanningPushProtection *SecretScanningPushProtection `json:"secret_scanning_push_protection,omitempty"` DependabotSecurityUpdates *DependabotSecurityUpdates `json:"dependabot_security_updates,omitempty"` + SecretScanningValidityChecks *SecretScanningValidityChecks `json:"secret_scanning_validity_checks"` } func (s SecurityAndAnalysis) String() string { @@ -248,6 +249,17 @@ func (d DependabotSecurityUpdates) String() string { return Stringify(d) } +// Specifies the state of secret scanning validity checks on a repository. +// +// Github API docs: https://docs.github.com/en/enterprise-cloud@latest/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository#allowing-validity-checks-for-partner-patterns-in-a-repository +type SecretScanningValidityChecks struct { + Status *string `json:"status,omitempty"` +} + +func (s SecretScanningValidityChecks) String() string { + return Stringify(s) +} + // List calls either RepositoriesService.ListByUser or RepositoriesService.ListByAuthenticatedUser // depending on whether user is empty. // diff --git a/github/repos_test.go b/github/repos_test.go index fa49ddd4f5c..2e61aeb1b1f 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -360,7 +360,7 @@ func TestRepositoriesService_Get(t *testing.T) { mux.HandleFunc("/repos/o/r", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) - fmt.Fprint(w, `{"id":1,"name":"n","description":"d","owner":{"login":"l"},"license":{"key":"mit"},"security_and_analysis":{"advanced_security":{"status":"enabled"},"secret_scanning":{"status":"enabled"},"secret_scanning_push_protection":{"status":"enabled"},"dependabot_security_updates":{"status": "enabled"}}}`) + fmt.Fprint(w, `{"id":1,"name":"n","description":"d","owner":{"login":"l"},"license":{"key":"mit"},"security_and_analysis":{"advanced_security":{"status":"enabled"},"secret_scanning":{"status":"enabled"},"secret_scanning_push_protection":{"status":"enabled"},"dependabot_security_updates":{"status": "enabled"}, "secret_scanning_validity_checks":{"status":"enabled"}}}`) }) ctx := context.Background() @@ -369,7 +369,7 @@ func TestRepositoriesService_Get(t *testing.T) { t.Errorf("Repositories.Get returned error: %v", err) } - want := &Repository{ID: Int64(1), Name: String("n"), Description: String("d"), Owner: &User{Login: String("l")}, License: &License{Key: String("mit")}, SecurityAndAnalysis: &SecurityAndAnalysis{AdvancedSecurity: &AdvancedSecurity{Status: String("enabled")}, SecretScanning: &SecretScanning{String("enabled")}, SecretScanningPushProtection: &SecretScanningPushProtection{String("enabled")}, DependabotSecurityUpdates: &DependabotSecurityUpdates{String("enabled")}}} + want := &Repository{ID: Int64(1), Name: String("n"), Description: String("d"), Owner: &User{Login: String("l")}, License: &License{Key: String("mit")}, SecurityAndAnalysis: &SecurityAndAnalysis{AdvancedSecurity: &AdvancedSecurity{Status: String("enabled")}, SecretScanning: &SecretScanning{String("enabled")}, SecretScanningPushProtection: &SecretScanningPushProtection{String("enabled")}, DependabotSecurityUpdates: &DependabotSecurityUpdates{String("enabled")}, SecretScanningValidityChecks: &SecretScanningValidityChecks{String("enabled")}}} if !cmp.Equal(got, want) { t.Errorf("Repositories.Get returned %+v, want %+v", got, want) } From d9da2a4ea25a41c0cd267b32c5654d6fc6882e61 Mon Sep 17 00:00:00 2001 From: tomasz-adam-skrzypczak Date: Mon, 11 Dec 2023 14:23:28 +0100 Subject: [PATCH 2/6] feat: add secret scanning validity checks enabled in organizations endpoint --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ github/github-stringify_test.go | 19 ++++++++++--------- github/orgs.go | 2 ++ 4 files changed, 30 insertions(+), 9 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index a47ba28243c..90e21407d51 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -12734,6 +12734,14 @@ func (o *Organization) GetSecretScanningPushProtectionEnabledForNewRepos() bool return *o.SecretScanningPushProtectionEnabledForNewRepos } +// GetSecretScanningValidityChecksEnabled returns the SecretScanningValidityChecksEnabled field if it's non-nil, zero value otherwise. +func (o *Organization) GetSecretScanningValidityChecksEnabled() bool { + if o == nil || o.SecretScanningValidityChecksEnabled == nil { + return false + } + return *o.SecretScanningValidityChecksEnabled +} + // GetTotalPrivateRepos returns the TotalPrivateRepos field if it's non-nil, zero value otherwise. func (o *Organization) GetTotalPrivateRepos() int64 { if o == nil || o.TotalPrivateRepos == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index bf1be2ded9e..9ca243437bc 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -14928,6 +14928,16 @@ func TestOrganization_GetSecretScanningPushProtectionEnabledForNewRepos(tt *test o.GetSecretScanningPushProtectionEnabledForNewRepos() } +func TestOrganization_GetSecretScanningValidityChecksEnabled(tt *testing.T) { + var zeroValue bool + o := &Organization{SecretScanningValidityChecksEnabled: &zeroValue} + o.GetSecretScanningValidityChecksEnabled() + o = &Organization{} + o.GetSecretScanningValidityChecksEnabled() + o = nil + o.GetSecretScanningValidityChecksEnabled() +} + func TestOrganization_GetTotalPrivateRepos(tt *testing.T) { var zeroValue int64 o := &Organization{TotalPrivateRepos: &zeroValue} diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 03a016529ff..9b4b55742d8 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1051,15 +1051,16 @@ func TestOrganization_String(t *testing.T) { DependencyGraphEnabledForNewRepos: Bool(false), SecretScanningEnabledForNewRepos: Bool(false), SecretScanningPushProtectionEnabledForNewRepos: Bool(false), - URL: String(""), - EventsURL: String(""), - HooksURL: String(""), - IssuesURL: String(""), - MembersURL: String(""), - PublicMembersURL: String(""), - ReposURL: String(""), - } - want := `github.Organization{Login:"", ID:0, NodeID:"", AvatarURL:"", HTMLURL:"", Name:"", Company:"", Blog:"", Location:"", Email:"", TwitterUsername:"", Description:"", PublicRepos:0, PublicGists:0, Followers:0, Following:0, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, TotalPrivateRepos:0, OwnedPrivateRepos:0, PrivateGists:0, DiskUsage:0, Collaborators:0, BillingEmail:"", Type:"", Plan:github.Plan{}, TwoFactorRequirementEnabled:false, IsVerified:false, HasOrganizationProjects:false, HasRepositoryProjects:false, DefaultRepoPermission:"", DefaultRepoSettings:"", MembersCanCreateRepos:false, MembersCanCreatePublicRepos:false, MembersCanCreatePrivateRepos:false, MembersCanCreateInternalRepos:false, MembersCanForkPrivateRepos:false, MembersAllowedRepositoryCreationType:"", MembersCanCreatePages:false, MembersCanCreatePublicPages:false, MembersCanCreatePrivatePages:false, WebCommitSignoffRequired:false, AdvancedSecurityEnabledForNewRepos:false, DependabotAlertsEnabledForNewRepos:false, DependabotSecurityUpdatesEnabledForNewRepos:false, DependencyGraphEnabledForNewRepos:false, SecretScanningEnabledForNewRepos:false, SecretScanningPushProtectionEnabledForNewRepos:false, URL:"", EventsURL:"", HooksURL:"", IssuesURL:"", MembersURL:"", PublicMembersURL:"", ReposURL:""}` + SecretScanningValidityChecksEnabled: Bool(false), + URL: String(""), + EventsURL: String(""), + HooksURL: String(""), + IssuesURL: String(""), + MembersURL: String(""), + PublicMembersURL: String(""), + ReposURL: String(""), + } + want := `github.Organization{Login:"", ID:0, NodeID:"", AvatarURL:"", HTMLURL:"", Name:"", Company:"", Blog:"", Location:"", Email:"", TwitterUsername:"", Description:"", PublicRepos:0, PublicGists:0, Followers:0, Following:0, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, TotalPrivateRepos:0, OwnedPrivateRepos:0, PrivateGists:0, DiskUsage:0, Collaborators:0, BillingEmail:"", Type:"", Plan:github.Plan{}, TwoFactorRequirementEnabled:false, IsVerified:false, HasOrganizationProjects:false, HasRepositoryProjects:false, DefaultRepoPermission:"", DefaultRepoSettings:"", MembersCanCreateRepos:false, MembersCanCreatePublicRepos:false, MembersCanCreatePrivateRepos:false, MembersCanCreateInternalRepos:false, MembersCanForkPrivateRepos:false, MembersAllowedRepositoryCreationType:"", MembersCanCreatePages:false, MembersCanCreatePublicPages:false, MembersCanCreatePrivatePages:false, WebCommitSignoffRequired:false, AdvancedSecurityEnabledForNewRepos:false, DependabotAlertsEnabledForNewRepos:false, DependabotSecurityUpdatesEnabledForNewRepos:false, DependencyGraphEnabledForNewRepos:false, SecretScanningEnabledForNewRepos:false, SecretScanningPushProtectionEnabledForNewRepos:false, SecretScanningValidityChecksEnabled:false, URL:"", EventsURL:"", HooksURL:"", IssuesURL:"", MembersURL:"", PublicMembersURL:"", ReposURL:""}` if got := v.String(); got != want { t.Errorf("Organization.String = %v, want %v", got, want) } diff --git a/github/orgs.go b/github/orgs.go index 4d3465271b6..27c0f102842 100644 --- a/github/orgs.go +++ b/github/orgs.go @@ -95,6 +95,8 @@ type Organization struct { SecretScanningEnabledForNewRepos *bool `json:"secret_scanning_enabled_for_new_repositories,omitempty"` // SecretScanningPushProtectionEnabledForNewRepos toggles whether secret scanning push protection is enabled on new repositories. SecretScanningPushProtectionEnabledForNewRepos *bool `json:"secret_scanning_push_protection_enabled_for_new_repositories,omitempty"` + // SecretScanningValidityChecksEnabled toggles whether secret scanning validity check is enabled. + SecretScanningValidityChecksEnabled *bool `json:"secret_scanning_validity_checks_enabled,omitempty"` // API URLs URL *string `json:"url,omitempty"` From 2ba77fbfb494b4e3c8890ec2f4873fb939bb45d4 Mon Sep 17 00:00:00 2001 From: tomasz-adam-skrzypczak Date: Mon, 11 Dec 2023 14:44:42 +0100 Subject: [PATCH 3/6] feat: add secret scanning validity checks enabled to enterprise endpoint --- github/enterprise_code_security_and_analysis.go | 1 + github/enterprise_code_security_and_analysis_test.go | 5 ++++- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 10 ++++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/github/enterprise_code_security_and_analysis.go b/github/enterprise_code_security_and_analysis.go index af8eb0ffb2f..159aeae4dca 100644 --- a/github/enterprise_code_security_and_analysis.go +++ b/github/enterprise_code_security_and_analysis.go @@ -16,6 +16,7 @@ type EnterpriseSecurityAnalysisSettings struct { SecretScanningEnabledForNewRepositories *bool `json:"secret_scanning_enabled_for_new_repositories,omitempty"` SecretScanningPushProtectionEnabledForNewRepositories *bool `json:"secret_scanning_push_protection_enabled_for_new_repositories,omitempty"` SecretScanningPushProtectionCustomLink *string `json:"secret_scanning_push_protection_custom_link,omitempty"` + SecretScanningValidityChecksEnabled *bool `json:"secret_scanning_validity_checks_enabled,omitempty"` } // GetCodeSecurityAndAnalysis gets code security and analysis features for an enterprise. diff --git a/github/enterprise_code_security_and_analysis_test.go b/github/enterprise_code_security_and_analysis_test.go index 25dbd941702..17bbe18beae 100644 --- a/github/enterprise_code_security_and_analysis_test.go +++ b/github/enterprise_code_security_and_analysis_test.go @@ -27,7 +27,8 @@ func TestEnterpriseService_GetCodeSecurityAndAnalysis(t *testing.T) { "advanced_security_enabled_for_new_repositories": true, "secret_scanning_enabled_for_new_repositories": true, "secret_scanning_push_protection_enabled_for_new_repositories": true, - "secret_scanning_push_protection_custom_link": "https://github.com/test-org/test-repo/blob/main/README.md" + "secret_scanning_push_protection_custom_link": "https://github.com/test-org/test-repo/blob/main/README.md", + "secret_scanning_validity_checks_enabled": true }`) }) @@ -44,6 +45,7 @@ func TestEnterpriseService_GetCodeSecurityAndAnalysis(t *testing.T) { SecretScanningEnabledForNewRepositories: Bool(true), SecretScanningPushProtectionEnabledForNewRepositories: Bool(true), SecretScanningPushProtectionCustomLink: String("https://github.com/test-org/test-repo/blob/main/README.md"), + SecretScanningValidityChecksEnabled: Bool(true), } if !cmp.Equal(settings, want) { @@ -73,6 +75,7 @@ func TestEnterpriseService_UpdateCodeSecurityAndAnalysis(t *testing.T) { SecretScanningEnabledForNewRepositories: Bool(true), SecretScanningPushProtectionEnabledForNewRepositories: Bool(true), SecretScanningPushProtectionCustomLink: String("https://github.com/test-org/test-repo/blob/main/README.md"), + SecretScanningValidityChecksEnabled: Bool(true), } mux.HandleFunc("/enterprises/e/code_security_and_analysis", func(w http.ResponseWriter, r *http.Request) { diff --git a/github/github-accessors.go b/github/github-accessors.go index 90e21407d51..4cb34b1260a 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -6974,6 +6974,14 @@ func (e *EnterpriseSecurityAnalysisSettings) GetSecretScanningPushProtectionEnab return *e.SecretScanningPushProtectionEnabledForNewRepositories } +// GetSecretScanningValidityChecksEnabled returns the SecretScanningValidityChecksEnabled field if it's non-nil, zero value otherwise. +func (e *EnterpriseSecurityAnalysisSettings) GetSecretScanningValidityChecksEnabled() bool { + if e == nil || e.SecretScanningValidityChecksEnabled == nil { + return false + } + return *e.SecretScanningValidityChecksEnabled +} + // GetCanAdminsBypass returns the CanAdminsBypass field if it's non-nil, zero value otherwise. func (e *Environment) GetCanAdminsBypass() bool { if e == nil || e.CanAdminsBypass == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 9ca243437bc..cdc27ab9966 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -8175,6 +8175,16 @@ func TestEnterpriseSecurityAnalysisSettings_GetSecretScanningPushProtectionEnabl e.GetSecretScanningPushProtectionEnabledForNewRepositories() } +func TestEnterpriseSecurityAnalysisSettings_GetSecretScanningValidityChecksEnabled(tt *testing.T) { + var zeroValue bool + e := &EnterpriseSecurityAnalysisSettings{SecretScanningValidityChecksEnabled: &zeroValue} + e.GetSecretScanningValidityChecksEnabled() + e = &EnterpriseSecurityAnalysisSettings{} + e.GetSecretScanningValidityChecksEnabled() + e = nil + e.GetSecretScanningValidityChecksEnabled() +} + func TestEnvironment_GetCanAdminsBypass(tt *testing.T) { var zeroValue bool e := &Environment{CanAdminsBypass: &zeroValue} From abd177d2b145732ef93120520fb3697960ce3322 Mon Sep 17 00:00:00 2001 From: tomasz-adam-skrzypczak Date: Tue, 12 Dec 2023 00:11:43 +0100 Subject: [PATCH 4/6] fix: comments in repos.go, add omitempty for SecurityAndAnalysis.SecretScanningValidityChecks's field --- github/repos.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/github/repos.go b/github/repos.go index 9c9a83e5ba2..fbfa16a3e63 100644 --- a/github/repos.go +++ b/github/repos.go @@ -198,7 +198,7 @@ type SecurityAndAnalysis struct { SecretScanning *SecretScanning `json:"secret_scanning,omitempty"` SecretScanningPushProtection *SecretScanningPushProtection `json:"secret_scanning_push_protection,omitempty"` DependabotSecurityUpdates *DependabotSecurityUpdates `json:"dependabot_security_updates,omitempty"` - SecretScanningValidityChecks *SecretScanningValidityChecks `json:"secret_scanning_validity_checks"` + SecretScanningValidityChecks *SecretScanningValidityChecks `json:"secret_scanning_validity_checks,omitempty"` } func (s SecurityAndAnalysis) String() string { @@ -249,9 +249,9 @@ func (d DependabotSecurityUpdates) String() string { return Stringify(d) } -// Specifies the state of secret scanning validity checks on a repository. +// SecretScanningValidityChecks represents the state of secret scanning validity checks on a repository. // -// Github API docs: https://docs.github.com/en/enterprise-cloud@latest/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository#allowing-validity-checks-for-partner-patterns-in-a-repository +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository#allowing-validity-checks-for-partner-patterns-in-a-repository type SecretScanningValidityChecks struct { Status *string `json:"status,omitempty"` } From 8ba177f4ce59d947632d92f1cd4b15cc2f2c4780 Mon Sep 17 00:00:00 2001 From: tomasz-adam-skrzypczak Date: Tue, 12 Dec 2023 13:44:39 +0100 Subject: [PATCH 5/6] fix: remove unnecessary String() function for SecretScanningValidityChecks --- github/repos.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/github/repos.go b/github/repos.go index fbfa16a3e63..a7574d72f07 100644 --- a/github/repos.go +++ b/github/repos.go @@ -256,10 +256,6 @@ type SecretScanningValidityChecks struct { Status *string `json:"status,omitempty"` } -func (s SecretScanningValidityChecks) String() string { - return Stringify(s) -} - // List calls either RepositoriesService.ListByUser or RepositoriesService.ListByAuthenticatedUser // depending on whether user is empty. // From ad453fa5349b49cfe65a3c90c572412639a2887f Mon Sep 17 00:00:00 2001 From: tomasz-adam-skrzypczak Date: Tue, 12 Dec 2023 16:57:45 +0100 Subject: [PATCH 6/6] fix: removing test - TestSecretScanningValidityChecks_String for not-existing String() method --- github/github-stringify_test.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index 9b4b55742d8..bb69ce1ad5a 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1821,16 +1821,6 @@ func TestSecretScanningPushProtection_String(t *testing.T) { } } -func TestSecretScanningValidityChecks_String(t *testing.T) { - v := SecretScanningValidityChecks{ - Status: String(""), - } - want := `github.SecretScanningValidityChecks{Status:""}` - if got := v.String(); got != want { - t.Errorf("SecretScanningValidityChecks.String = %v, want %v", got, want) - } -} - func TestSecurityAndAnalysis_String(t *testing.T) { v := SecurityAndAnalysis{ AdvancedSecurity: &AdvancedSecurity{},