Repository: google/go-github
Pull request #3025 (2023-12-09 15:54:52)

Support temporary private fork creation via API
resolved: #3007

google-cla[bot]: Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this [failed invocation](https://github.com/google/go-github/pull/3025/checks?check_run_id=19477151260) of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.
codecov[bot]: ## [Codecov](https://app.codecov.io/gh/google/go-github/pull/3025?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) Report
Attention: `3 lines` in your changes are missing coverage. Please review.
> Comparison is base [(`062b611`)](https://app.codecov.io/gh/google/go-github/commit/062b6119e47d73486fe40193262708332f1dc9be?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) 97.91% compared to head [(`c8d8dee`)](https://app.codecov.io/gh/google/go-github/pull/3025?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) 97.89%.
> Report is 2 commits behind head on master.

| [Files](https://app.codecov.io/gh/google/go-github/pull/3025?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) | Patch % | Lines |
|---|---|---|
| [github/security\_advisories.go](https://app.codecov.io/gh/google/go-github/pull/3025?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google#diff-Z2l0aHViL3NlY3VyaXR5X2Fkdmlzb3JpZXMuZ28=) | 82.35% | [2 Missing and 1 partial :warning: ](https://app.codecov.io/gh/google/go-github/pull/3025?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) |

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


```diff
@@            Coverage Diff             @@
##           master    #3025      +/-   ##
==========================================
- Coverage   97.91%   97.89%   -0.03%     
==========================================
  Files         150      150              
  Lines       12980    12997      +17     
==========================================
+ Hits        12710    12724      +14     
- Misses        192      194       +2     
- Partials       78       79       +1     
```



</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/google/go-github/pull/3025?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).

Kiyo510: @gmlewis 
Thanks for reviewing my PR.
Since I made a modification, please check it out again.

Patch:
diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml
index f9d6d7e4..24f3d909 100644
--- a/.github/workflows/linter.yml
+++ b/.github/workflows/linter.yml
@@ -9,7 +9,7 @@ jobs:
     runs-on: ubuntu-latest
     steps:
     - uses: actions/checkout@v4
-    - uses: actions/setup-go@v4
+    - uses: actions/setup-go@v5
       with:
         go-version: 1.x
         cache-dependency-path: "**/go.sum"
diff --git a/github/enterprise_code_security_and_analysis.go b/github/enterprise_code_security_and_analysis.go
index af8eb0ff..159aeae4 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/github-accessors.go b/github/github-accessors.go
index e15eb102..02d1212c 100644
--- a/github/github-accessors.go
+++ b/github/github-accessors.go
@@ -1454,6 +1454,14 @@ func (a *AuditEntry) GetReadOnly() string {
 	return *a.ReadOnly
 }
 
+// GetReferrer returns the Referrer field if it's non-nil, zero value otherwise.
+func (a *AuditEntry) GetReferrer() string {
+	if a == nil || a.Referrer == nil {
+		return ""
+	}
+	return *a.Referrer
+}
+
 // GetRepo returns the Repo field if it's non-nil, zero value otherwise.
 func (a *AuditEntry) GetRepo() string {
 	if a == nil || a.Repo == nil {
@@ -6974,6 +6982,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 {
@@ -12734,6 +12750,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 {
@@ -17766,6 +17790,14 @@ func (r *RateLimits) GetCodeScanningUpload() *Rate {
 	return r.CodeScanningUpload
 }
 
+// GetCodeSearch returns the CodeSearch field.
+func (r *RateLimits) GetCodeSearch() *Rate {
+	if r == nil {
+		return nil
+	}
+	return r.CodeSearch
+}
+
 // GetCore returns the Core field.
 func (r *RateLimits) GetCore() *Rate {
 	if r == nil {
@@ -17774,6 +17806,14 @@ func (r *RateLimits) GetCore() *Rate {
 	return r.Core
 }
 
+// GetDependencySnapshots returns the DependencySnapshots field.
+func (r *RateLimits) GetDependencySnapshots() *Rate {
+	if r == nil {
+		return nil
+	}
+	return r.DependencySnapshots
+}
+
 // GetGraphQL returns the GraphQL field.
 func (r *RateLimits) GetGraphQL() *Rate {
 	if r == nil {
@@ -21590,6 +21630,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 +21878,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.go b/github/github.go
index c248b256..e4103636 100644
--- a/github/github.go
+++ b/github/github.go
@@ -1303,6 +1303,8 @@ const (
 	codeScanningUploadCategory
 	actionsRunnerRegistrationCategory
 	scimCategory
+	dependencySnapshotsCategory
+	codeSearchCategory
 
 	categories // An array of this length will be able to contain all rate limit categories.
 )
@@ -1315,6 +1317,12 @@ func category(method, path string) rateLimitCategory {
 		// NOTE: coreCategory is returned for actionsRunnerRegistrationCategory too,
 		// because no API found for this category.
 		return coreCategory
+
+	// https://docs.github.com/en/rest/search/search#search-code
+	case strings.HasPrefix(path, "/search/code") &&
+		method == http.MethodGet:
+		return codeSearchCategory
+
 	case strings.HasPrefix(path, "/search/"):
 		return searchCategory
 	case path == "/graphql":
@@ -1337,6 +1345,12 @@ func category(method, path string) rateLimitCategory {
 	// https://docs.github.com/enterprise-cloud@latest/rest/scim
 	case strings.HasPrefix(path, "/scim/"):
 		return scimCategory
+
+	// https://docs.github.com/en/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository
+	case strings.HasPrefix(path, "/repos/") &&
+		strings.HasSuffix(path, "/dependency-graph/snapshots") &&
+		method == http.MethodPost:
+		return dependencySnapshotsCategory
 	}
 }
 
diff --git a/github/orgs.go b/github/orgs.go
index 4d346527..27c0f102 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"`
diff --git a/github/orgs_audit_log.go b/github/orgs_audit_log.go
index e3afd311..aa359135 100644
--- a/github/orgs_audit_log.go
+++ b/github/orgs_audit_log.go
@@ -95,6 +95,7 @@ type AuditEntry struct {
 	PullRequestURL           *string                 `json:"pull_request_url,omitempty"`
 	ReadOnly                 *string                 `json:"read_only,omitempty"`
 	Reasons                  []*PolicyOverrideReason `json:"reasons,omitempty"`
+	Referrer                 *string                 `json:"referrer,omitempty"`
 	Repo                     *string                 `json:"repo,omitempty"`
 	Repository               *string                 `json:"repository,omitempty"`
 	RepositoryPublic         *bool                   `json:"repository_public,omitempty"`
diff --git a/github/rate_limit.go b/github/rate_limit.go
index 0fc15f81..febe5edc 100644
--- a/github/rate_limit.go
+++ b/github/rate_limit.go
@@ -52,6 +52,8 @@ type RateLimits struct {
 	CodeScanningUpload        *Rate `json:"code_scanning_upload"`
 	ActionsRunnerRegistration *Rate `json:"actions_runner_registration"`
 	SCIM                      *Rate `json:"scim"`
+	DependencySnapshots       *Rate `json:"dependency_snapshots"`
+	CodeSearch                *Rate `json:"code_search"`
 }
 
 func (r RateLimits) String() string {
@@ -106,6 +108,12 @@ func (s *RateLimitService) Get(ctx context.Context) (*RateLimits, *Response, err
 		if response.Resources.SCIM != nil {
 			s.client.rateLimits[scimCategory] = *response.Resources.SCIM
 		}
+		if response.Resources.DependencySnapshots != nil {
+			s.client.rateLimits[dependencySnapshotsCategory] = *response.Resources.DependencySnapshots
+		}
+		if response.Resources.CodeSearch != nil {
+			s.client.rateLimits[codeSearchCategory] = *response.Resources.CodeSearch
+		}
 		s.client.rateMu.Unlock()
 	}
 
diff --git a/github/repos.go b/github/repos.go
index 5fcf219b..a7574d72 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,omitempty"`
 }
 
 func (s SecurityAndAnalysis) String() string {
@@ -248,6 +249,13 @@ func (d DependabotSecurityUpdates) String() string {
 	return Stringify(d)
 }
 
+// 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
+type SecretScanningValidityChecks struct {
+	Status *string `json:"status,omitempty"`
+}
+
 // List calls either RepositoriesService.ListByUser or RepositoriesService.ListByAuthenticatedUser
 // depending on whether user is empty.
 //
diff --git a/github/security_advisories.go b/github/security_advisories.go
index 63526374..b5a43f1a 100644
--- a/github/security_advisories.go
+++ b/github/security_advisories.go
@@ -7,6 +7,7 @@ package github
 
 import (
 	"context"
+	"encoding/json"
 	"fmt"
 )
 
@@ -148,6 +149,36 @@ func (s *SecurityAdvisoriesService) RequestCVE(ctx context.Context, owner, repo,
 	return resp, nil
 }
 
+// CreateTemporaryPrivateFork creates a temporary private fork to collaborate on fixing a security vulnerability in your repository.
+// The ghsaID is the GitHub Security Advisory identifier of the advisory.
+//
+// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories#create-a-temporary-private-fork
+//
+//meta:operation POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks
+func (s *SecurityAdvisoriesService) CreateTemporaryPrivateFork(ctx context.Context, owner, repo, ghsaID string) (*Repository, *Response, error) {
+	url := fmt.Sprintf("repos/%v/%v/security-advisories/%v/forks", owner, repo, ghsaID)
+
+	req, err := s.client.NewRequest("POST", url, nil)
+	if err != nil {
+		return nil, nil, err
+	}
+
+	fork := new(Repository)
+	resp, err := s.client.Do(ctx, req, fork)
+	if err != nil {
+		if aerr, ok := err.(*AcceptedError); ok {
+			if err := json.Unmarshal(aerr.Raw, fork); err != nil {
+				return fork, resp, err
+			}
+
+			return fork, resp, err
+		}
+		return nil, resp, err
+	}
+
+	return fork, resp, nil
+}
+
 // ListRepositorySecurityAdvisoriesForOrg lists the repository security advisories for an organization.
 //
 // GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories-for-an-organization


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index b3abd8b6..3067b1b0 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -39,7 +39,7 @@ jobs:
     runs-on: ${{ matrix.platform }}
 
     steps:
-    - uses: actions/setup-go@v4
+    - uses: actions/setup-go@v5
       with:
         go-version: ${{ matrix.go-version }}
     - uses: actions/checkout@v4
diff --git a/github/enterprise_code_security_and_analysis_test.go b/github/enterprise_code_security_and_analysis_test.go
index 25dbd941..17bbe18b 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_test.go b/github/github-accessors_test.go
index 84d104f1..6ae89e45 100644
--- a/github/github-accessors_test.go
+++ b/github/github-accessors_test.go
@@ -1731,6 +1731,16 @@ func TestAuditEntry_GetReadOnly(tt *testing.T) {
 	a.GetReadOnly()
 }
 
+func TestAuditEntry_GetReferrer(tt *testing.T) {
+	var zeroValue string
+	a := &AuditEntry{Referrer: &zeroValue}
+	a.GetReferrer()
+	a = &AuditEntry{}
+	a.GetReferrer()
+	a = nil
+	a.GetReferrer()
+}
+
 func TestAuditEntry_GetRepo(tt *testing.T) {
 	var zeroValue string
 	a := &AuditEntry{Repo: &zeroValue}
@@ -8175,6 +8185,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}
@@ -14928,6 +14948,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}
@@ -20606,6 +20636,13 @@ func TestRateLimits_GetCodeScanningUpload(tt *testing.T) {
 	r.GetCodeScanningUpload()
 }
 
+func TestRateLimits_GetCodeSearch(tt *testing.T) {
+	r := &RateLimits{}
+	r.GetCodeSearch()
+	r = nil
+	r.GetCodeSearch()
+}
+
 func TestRateLimits_GetCore(tt *testing.T) {
 	r := &RateLimits{}
 	r.GetCore()
@@ -20613,6 +20650,13 @@ func TestRateLimits_GetCore(tt *testing.T) {
 	r.GetCore()
 }
 
+func TestRateLimits_GetDependencySnapshots(tt *testing.T) {
+	r := &RateLimits{}
+	r.GetDependencySnapshots()
+	r = nil
+	r.GetDependencySnapshots()
+}
+
 func TestRateLimits_GetGraphQL(tt *testing.T) {
 	r := &RateLimits{}
 	r.GetGraphQL()
@@ -25149,6 +25193,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 +25458,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 7472edfd..bb69ce1a 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(""),
+		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, URL:"", EventsURL:"", HooksURL:"", IssuesURL:"", MembersURL:"", PublicMembersURL:"", ReposURL:""}`
+	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)
 	}
@@ -1826,8 +1827,9 @@ func TestSecurityAndAnalysis_String(t *testing.T) {
 		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/github_test.go b/github/github_test.go
index b994496c..933d29e7 100644
--- a/github/github_test.go
+++ b/github/github_test.go
@@ -1153,6 +1153,16 @@ func TestDo_rateLimitCategory(t *testing.T) {
 			url:      "/scim/v2/organizations/ORG/Users",
 			category: scimCategory,
 		},
+		{
+			method:   http.MethodPost,
+			url:      "/repos/google/go-github/dependency-graph/snapshots",
+			category: dependencySnapshotsCategory,
+		},
+		{
+			method:   http.MethodGet,
+			url:      "/search/code?q=rate",
+			category: codeSearchCategory,
+		},
 		// missing a check for actionsRunnerRegistrationCategory: API not found
 	}
 
diff --git a/github/rate_limit_test.go b/github/rate_limit_test.go
index 167288bc..da8a68c9 100644
--- a/github/rate_limit_test.go
+++ b/github/rate_limit_test.go
@@ -25,8 +25,10 @@ func TestRateLimits_String(t *testing.T) {
 		CodeScanningUpload:        &Rate{},
 		ActionsRunnerRegistration: &Rate{},
 		SCIM:                      &Rate{},
+		DependencySnapshots:       &Rate{},
+		CodeSearch:                &Rate{},
 	}
-	want := `github.RateLimits{Core:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, Search:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, GraphQL:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, IntegrationManifest:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SourceImport:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, CodeScanningUpload:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, ActionsRunnerRegistration:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SCIM:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}}`
+	want := `github.RateLimits{Core:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, Search:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, GraphQL:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, IntegrationManifest:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SourceImport:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, CodeScanningUpload:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, ActionsRunnerRegistration:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, SCIM:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, DependencySnapshots:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}, CodeSearch:github.Rate{Limit:0, Remaining:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}}`
 	if got := v.String(); got != want {
 		t.Errorf("RateLimits.String = %v, want %v", got, want)
 	}
@@ -46,7 +48,9 @@ func TestRateLimits(t *testing.T) {
 			"source_import": {"limit":6,"remaining":5,"reset":1372700877},
 			"code_scanning_upload": {"limit":7,"remaining":6,"reset":1372700878},
 			"actions_runner_registration": {"limit":8,"remaining":7,"reset":1372700879},
-			"scim": {"limit":9,"remaining":8,"reset":1372700880}
+			"scim": {"limit":9,"remaining":8,"reset":1372700880},
+			"dependency_snapshots": {"limit":10,"remaining":9,"reset":1372700881},
+			"code_search": {"limit":11,"remaining":10,"reset":1372700882}
 		}}`)
 	})
 
@@ -97,6 +101,16 @@ func TestRateLimits(t *testing.T) {
 			Remaining: 8,
 			Reset:     Timestamp{time.Date(2013, time.July, 1, 17, 48, 00, 0, time.UTC).Local()},
 		},
+		DependencySnapshots: &Rate{
+			Limit:     10,
+			Remaining: 9,
+			Reset:     Timestamp{time.Date(2013, time.July, 1, 17, 48, 1, 0, time.UTC).Local()},
+		},
+		CodeSearch: &Rate{
+			Limit:     11,
+			Remaining: 10,
+			Reset:     Timestamp{time.Date(2013, time.July, 1, 17, 48, 2, 0, time.UTC).Local()},
+		},
 	}
 	if !cmp.Equal(rate, want) {
 		t.Errorf("RateLimits returned %+v, want %+v", rate, want)
@@ -137,6 +151,14 @@ func TestRateLimits(t *testing.T) {
 			category: scimCategory,
 			rate:     want.SCIM,
 		},
+		{
+			category: dependencySnapshotsCategory,
+			rate:     want.DependencySnapshots,
+		},
+		{
+			category: codeSearchCategory,
+			rate:     want.CodeSearch,
+		},
 	}
 
 	for _, tt := range tests {
@@ -177,7 +199,9 @@ func TestRateLimits_overQuota(t *testing.T) {
 			"source_import": {"limit":6,"remaining":5,"reset":1372700877},
 			"code_scanning_upload": {"limit":7,"remaining":6,"reset":1372700878},
 			"actions_runner_registration": {"limit":8,"remaining":7,"reset":1372700879},
-			"scim": {"limit":9,"remaining":8,"reset":1372700880}
+			"scim": {"limit":9,"remaining":8,"reset":1372700880},
+			"dependency_snapshots": {"limit":10,"remaining":9,"reset":1372700881},
+			"code_search": {"limit":11,"remaining":10,"reset":1372700882}
 		}}`)
 	})
 
@@ -228,6 +252,16 @@ func TestRateLimits_overQuota(t *testing.T) {
 			Remaining: 8,
 			Reset:     Timestamp{time.Date(2013, time.July, 1, 17, 48, 00, 0, time.UTC).Local()},
 		},
+		DependencySnapshots: &Rate{
+			Limit:     10,
+			Remaining: 9,
+			Reset:     Timestamp{time.Date(2013, time.July, 1, 17, 48, 1, 0, time.UTC).Local()},
+		},
+		CodeSearch: &Rate{
+			Limit:     11,
+			Remaining: 10,
+			Reset:     Timestamp{time.Date(2013, time.July, 1, 17, 48, 2, 0, time.UTC).Local()},
+		},
 	}
 	if !cmp.Equal(rate, want) {
 		t.Errorf("RateLimits returned %+v, want %+v", rate, want)
@@ -269,6 +303,14 @@ func TestRateLimits_overQuota(t *testing.T) {
 			category: scimCategory,
 			rate:     want.SCIM,
 		},
+		{
+			category: dependencySnapshotsCategory,
+			rate:     want.DependencySnapshots,
+		},
+		{
+			category: codeSearchCategory,
+			rate:     want.CodeSearch,
+		},
 	}
 	for _, tt := range tests {
 		if got, want := client.rateLimits[tt.category], *tt.rate; got != want {
@@ -321,6 +363,16 @@ func TestRateLimits_Marshal(t *testing.T) {
 			Remaining: 1,
 			Reset:     Timestamp{referenceTime},
 		},
+		DependencySnapshots: &Rate{
+			Limit:     1,
+			Remaining: 1,
+			Reset:     Timestamp{referenceTime},
+		},
+		CodeSearch: &Rate{
+			Limit:     1,
+			Remaining: 1,
+			Reset:     Timestamp{referenceTime},
+		},
 	}
 
 	want := `{
@@ -363,6 +415,16 @@ func TestRateLimits_Marshal(t *testing.T) {
 			"limit": 1,
 			"remaining": 1,
 			"reset": ` + referenceTimeStr + `
+		},
+		"dependency_snapshots": {
+			"limit": 1,
+			"remaining": 1,
+			"reset": ` + referenceTimeStr + `
+		},
+		"code_search": {
+			"limit": 1,
+			"remaining": 1,
+			"reset": ` + referenceTimeStr + `
 		}
 	}`
 
diff --git a/github/repos_test.go b/github/repos_test.go
index fa49ddd4..2e61aeb1 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)
 	}
diff --git a/github/security_advisories_test.go b/github/security_advisories_test.go
index 918e3e05..eb8e7d31 100644
--- a/github/security_advisories_test.go
+++ b/github/security_advisories_test.go
@@ -56,6 +56,472 @@ func TestSecurityAdvisoriesService_RequestCVE(t *testing.T) {
 	})
 }
 
+func TestSecurityAdvisoriesService_CreateTemporaryPrivateFork(t *testing.T) {
+	client, mux, _, teardown := setup()
+	defer teardown()
+
+	mux.HandleFunc("/repos/o/r/security-advisories/ghsa_id/forks", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, "POST")
+		fmt.Fprint(w, `{
+			"id": 1,
+			"node_id": "R_kgDPP3c6pQ",
+			"owner": {
+				"login": "owner",
+				"id": 2,
+				"node_id": "MDQ6VXFGcjYyMjcyMTQw",
+				"avatar_url": "https://avatars.githubusercontent.com/u/111111?v=4",
+				"html_url": "https://github.com/xxxxx",
+				"gravatar_id": "",
+				"type": "User",
+				"site_admin": false,
+				"url": "https://api.github.com/users/owner",
+				"events_url": "https://api.github.com/users/owner/events{/privacy}",
+				"following_url": "https://api.github.com/users/owner/following{/other_user}",
+				"followers_url": "https://api.github.com/users/owner/followers",
+				"gists_url": "https://api.github.com/users/owner/gists{/gist_id}",
+				"organizations_url": "https://api.github.com/users/owner/orgs",
+				"received_events_url": "https://api.github.com/users/owner/received_events",
+				"repos_url": "https://api.github.com/users/owner/repos",
+				"starred_url": "https://api.github.com/users/owner/starred{/owner}{/repo}",
+				"subscriptions_url": "https://api.github.com/users/owner/subscriptions"
+			},
+			"name": "repo-ghsa-xxxx-xxxx-xxxx",
+			"full_name": "owner/repo-ghsa-xxxx-xxxx-xxxx",
+			"default_branch": "master",
+			"created_at": "2023-12-08T17:22:41Z",
+			"pushed_at": "2023-12-03T11:27:08Z",
+			"updated_at": "2023-12-08T17:22:42Z",
+			"html_url": "https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx",
+			"clone_url": "https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git",
+			"git_url": "git://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git",
+			"ssh_url": "git@github.com:owner/repo-ghsa-xxxx-xxxx-xxxx.git",
+			"svn_url": "https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx",
+			"fork": false,
+			"forks_count": 0,
+			"network_count": 0,
+			"open_issues_count": 0,
+			"open_issues": 0,
+			"stargazers_count": 0,
+			"subscribers_count": 0,
+			"watchers_count": 0,
+			"watchers": 0,
+			"size": 0,
+			"permissions": {
+				"admin": true,
+				"maintain": true,
+				"pull": true,
+				"push": true,
+				"triage": true
+			},
+			"allow_forking": true,
+			"web_commit_signoff_required": false,
+			"archived": false,
+			"disabled": false,
+			"private": true,
+			"has_issues": false,
+			"has_wiki": false,
+			"has_pages": false,
+			"has_projects": false,
+			"has_downloads": false,
+			"has_discussions": false,
+			"is_template": false,
+			"url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx",
+			"archive_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/{archive_format}{/ref}",
+			"assignees_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/assignees{/user}",
+			"blobs_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/blobs{/sha}",
+			"branches_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/branches{/branch}",
+			"collaborators_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/collaborators{/collaborator}",
+			"comments_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/comments{/number}",
+			"commits_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/commits{/sha}",
+			"compare_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/compare/{base}...{head}",
+			"contents_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contents/{+path}",
+			"contributors_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contributors",
+			"deployments_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/deployments",
+			"downloads_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/downloads",
+			"events_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/events",
+			"forks_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/forks",
+			"git_commits_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/commits{/sha}",
+			"git_refs_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/refs{/sha}",
+			"git_tags_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/tags{/sha}",
+			"hooks_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/hooks",
+			"issue_comment_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/comments{/number}",
+			"issue_events_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/events{/number}",
+			"issues_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues{/number}",
+			"keys_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/keys{/key_id}",
+			"labels_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/labels{/name}",
+			"languages_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/languages",
+			"merges_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/merges",
+			"milestones_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/milestones{/number}",
+			"notifications_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/notifications{?since,all,participating}",
+			"pulls_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/pulls{/number}",
+			"releases_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/releases{/id}",
+			"stargazers_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/stargazers",
+			"statuses_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/statuses/{sha}",
+			"subscribers_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscribers",
+			"subscription_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscription",
+			"tags_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/tags",
+			"teams_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/teams",
+			"visibility": "private"
+		}`)
+	})
+
+	ctx := context.Background()
+	fork, _, err := client.SecurityAdvisories.CreateTemporaryPrivateFork(ctx, "o", "r", "ghsa_id")
+	if err != nil {
+		t.Errorf("SecurityAdvisoriesService.CreateTemporaryPrivateFork returned error: %v", err)
+	}
+
+	want := &Repository{
+		ID:     Int64(1),
+		NodeID: String("R_kgDPP3c6pQ"),
+		Owner: &User{
+			Login:             String("owner"),
+			ID:                Int64(2),
+			NodeID:            String("MDQ6VXFGcjYyMjcyMTQw"),
+			AvatarURL:         String("https://avatars.githubusercontent.com/u/111111?v=4"),
+			HTMLURL:           String("https://github.com/xxxxx"),
+			GravatarID:        String(""),
+			Type:              String("User"),
+			SiteAdmin:         Bool(false),
+			URL:               String("https://api.github.com/users/owner"),
+			EventsURL:         String("https://api.github.com/users/owner/events{/privacy}"),
+			FollowingURL:      String("https://api.github.com/users/owner/following{/other_user}"),
+			FollowersURL:      String("https://api.github.com/users/owner/followers"),
+			GistsURL:          String("https://api.github.com/users/owner/gists{/gist_id}"),
+			OrganizationsURL:  String("https://api.github.com/users/owner/orgs"),
+			ReceivedEventsURL: String("https://api.github.com/users/owner/received_events"),
+			ReposURL:          String("https://api.github.com/users/owner/repos"),
+			StarredURL:        String("https://api.github.com/users/owner/starred{/owner}{/repo}"),
+			SubscriptionsURL:  String("https://api.github.com/users/owner/subscriptions"),
+		},
+		Name:             String("repo-ghsa-xxxx-xxxx-xxxx"),
+		FullName:         String("owner/repo-ghsa-xxxx-xxxx-xxxx"),
+		DefaultBranch:    String("master"),
+		CreatedAt:        &Timestamp{time.Date(2023, time.December, 8, 17, 22, 41, 0, time.UTC)},
+		PushedAt:         &Timestamp{time.Date(2023, time.December, 3, 11, 27, 8, 0, time.UTC)},
+		UpdatedAt:        &Timestamp{time.Date(2023, time.December, 8, 17, 22, 42, 0, time.UTC)},
+		HTMLURL:          String("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx"),
+		CloneURL:         String("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git"),
+		GitURL:           String("git://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git"),
+		SSHURL:           String("git@github.com:owner/repo-ghsa-xxxx-xxxx-xxxx.git"),
+		SVNURL:           String("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx"),
+		Fork:             Bool(false),
+		ForksCount:       Int(0),
+		NetworkCount:     Int(0),
+		OpenIssuesCount:  Int(0),
+		OpenIssues:       Int(0),
+		StargazersCount:  Int(0),
+		SubscribersCount: Int(0),
+		WatchersCount:    Int(0),
+		Watchers:         Int(0),
+		Size:             Int(0),
+		Permissions: map[string]bool{
+			"admin":    true,
+			"maintain": true,
+			"pull":     true,
+			"push":     true,
+			"triage":   true,
+		},
+		AllowForking:             Bool(true),
+		WebCommitSignoffRequired: Bool(false),
+		Archived:                 Bool(false),
+		Disabled:                 Bool(false),
+		Private:                  Bool(true),
+		HasIssues:                Bool(false),
+		HasWiki:                  Bool(false),
+		HasPages:                 Bool(false),
+		HasProjects:              Bool(false),
+		HasDownloads:             Bool(false),
+		HasDiscussions:           Bool(false),
+		IsTemplate:               Bool(false),
+		URL:                      String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx"),
+		ArchiveURL:               String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/{archive_format}{/ref}"),
+		AssigneesURL:             String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/assignees{/user}"),
+		BlobsURL:                 String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/blobs{/sha}"),
+		BranchesURL:              String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/branches{/branch}"),
+		CollaboratorsURL:         String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/collaborators{/collaborator}"),
+		CommentsURL:              String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/comments{/number}"),
+		CommitsURL:               String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/commits{/sha}"),
+		CompareURL:               String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/compare/{base}...{head}"),
+		ContentsURL:              String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contents/{+path}"),
+		ContributorsURL:          String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contributors"),
+		DeploymentsURL:           String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/deployments"),
+		DownloadsURL:             String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/downloads"),
+		EventsURL:                String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/events"),
+		ForksURL:                 String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/forks"),
+		GitCommitsURL:            String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/commits{/sha}"),
+		GitRefsURL:               String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/refs{/sha}"),
+		GitTagsURL:               String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/tags{/sha}"),
+		HooksURL:                 String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/hooks"),
+		IssueCommentURL:          String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/comments{/number}"),
+		IssueEventsURL:           String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/events{/number}"),
+		IssuesURL:                String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues{/number}"),
+		KeysURL:                  String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/keys{/key_id}"),
+		LabelsURL:                String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/labels{/name}"),
+		LanguagesURL:             String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/languages"),
+		MergesURL:                String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/merges"),
+		MilestonesURL:            String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/milestones{/number}"),
+		NotificationsURL:         String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/notifications{?since,all,participating}"),
+		PullsURL:                 String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/pulls{/number}"),
+		ReleasesURL:              String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/releases{/id}"),
+		StargazersURL:            String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/stargazers"),
+		StatusesURL:              String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/statuses/{sha}"),
+		SubscribersURL:           String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscribers"),
+		SubscriptionURL:          String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscription"),
+		TagsURL:                  String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/tags"),
+		TeamsURL:                 String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/teams"),
+		Visibility:               String("private"),
+	}
+	if !cmp.Equal(fork, want) {
+		t.Errorf("SecurityAdvisoriesService.CreateTemporaryPrivateFork returned %+v, want %+v", fork, want)
+	}
+
+	const methodName = "CreateTemporaryPrivateFork"
+	testBadOptions(t, methodName, func() (err error) {
+		_, _, err = client.SecurityAdvisories.CreateTemporaryPrivateFork(ctx, "\n", "\n", "\n")
+		return err
+	})
+
+	testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
+		got, resp, err := client.SecurityAdvisories.CreateTemporaryPrivateFork(ctx, "o", "r", "ghsa_id")
+		if got != nil {
+			t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
+		}
+		return resp, err
+	})
+}
+
+func TestSecurityAdvisoriesService_CreateTemporaryPrivateFork_deferred(t *testing.T) {
+	client, mux, _, teardown := setup()
+	defer teardown()
+
+	mux.HandleFunc("/repos/o/r/security-advisories/ghsa_id/forks", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, "POST")
+		w.WriteHeader(http.StatusAccepted)
+		fmt.Fprint(w, `{
+			"id": 1,
+			"node_id": "R_kgDPP3c6pQ",
+			"owner": {
+				"login": "owner",
+				"id": 2,
+				"node_id": "MDQ6VXFGcjYyMjcyMTQw",
+				"avatar_url": "https://avatars.githubusercontent.com/u/111111?v=4",
+				"html_url": "https://github.com/xxxxx",
+				"gravatar_id": "",
+				"type": "User",
+				"site_admin": false,
+				"url": "https://api.github.com/users/owner",
+				"events_url": "https://api.github.com/users/owner/events{/privacy}",
+				"following_url": "https://api.github.com/users/owner/following{/other_user}",
+				"followers_url": "https://api.github.com/users/owner/followers",
+				"gists_url": "https://api.github.com/users/owner/gists{/gist_id}",
+				"organizations_url": "https://api.github.com/users/owner/orgs",
+				"received_events_url": "https://api.github.com/users/owner/received_events",
+				"repos_url": "https://api.github.com/users/owner/repos",
+				"starred_url": "https://api.github.com/users/owner/starred{/owner}{/repo}",
+				"subscriptions_url": "https://api.github.com/users/owner/subscriptions"
+			},
+			"name": "repo-ghsa-xxxx-xxxx-xxxx",
+			"full_name": "owner/repo-ghsa-xxxx-xxxx-xxxx",
+			"default_branch": "master",
+			"created_at": "2023-12-08T17:22:41Z",
+			"pushed_at": "2023-12-03T11:27:08Z",
+			"updated_at": "2023-12-08T17:22:42Z",
+			"html_url": "https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx",
+			"clone_url": "https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git",
+			"git_url": "git://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git",
+			"ssh_url": "git@github.com:owner/repo-ghsa-xxxx-xxxx-xxxx.git",
+			"svn_url": "https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx",
+			"fork": false,
+			"forks_count": 0,
+			"network_count": 0,
+			"open_issues_count": 0,
+			"open_issues": 0,
+			"stargazers_count": 0,
+			"subscribers_count": 0,
+			"watchers_count": 0,
+			"watchers": 0,
+			"size": 0,
+			"permissions": {
+				"admin": true,
+				"maintain": true,
+				"pull": true,
+				"push": true,
+				"triage": true
+			},
+			"allow_forking": true,
+			"web_commit_signoff_required": false,
+			"archived": false,
+			"disabled": false,
+			"private": true,
+			"has_issues": false,
+			"has_wiki": false,
+			"has_pages": false,
+			"has_projects": false,
+			"has_downloads": false,
+			"has_discussions": false,
+			"is_template": false,
+			"url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx",
+			"archive_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/{archive_format}{/ref}",
+			"assignees_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/assignees{/user}",
+			"blobs_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/blobs{/sha}",
+			"branches_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/branches{/branch}",
+			"collaborators_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/collaborators{/collaborator}",
+			"comments_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/comments{/number}",
+			"commits_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/commits{/sha}",
+			"compare_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/compare/{base}...{head}",
+			"contents_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contents/{+path}",
+			"contributors_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contributors",
+			"deployments_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/deployments",
+			"downloads_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/downloads",
+			"events_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/events",
+			"forks_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/forks",
+			"git_commits_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/commits{/sha}",
+			"git_refs_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/refs{/sha}",
+			"git_tags_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/tags{/sha}",
+			"hooks_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/hooks",
+			"issue_comment_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/comments{/number}",
+			"issue_events_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/events{/number}",
+			"issues_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues{/number}",
+			"keys_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/keys{/key_id}",
+			"labels_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/labels{/name}",
+			"languages_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/languages",
+			"merges_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/merges",
+			"milestones_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/milestones{/number}",
+			"notifications_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/notifications{?since,all,participating}",
+			"pulls_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/pulls{/number}",
+			"releases_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/releases{/id}",
+			"stargazers_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/stargazers",
+			"statuses_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/statuses/{sha}",
+			"subscribers_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscribers",
+			"subscription_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscription",
+			"tags_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/tags",
+			"teams_url": "https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/teams",
+			"visibility": "private"
+		}`)
+	})
+
+	ctx := context.Background()
+	fork, _, err := client.SecurityAdvisories.CreateTemporaryPrivateFork(ctx, "o", "r", "ghsa_id")
+	if _, ok := err.(*AcceptedError); !ok {
+		t.Errorf("SecurityAdvisoriesService.CreateTemporaryPrivateFork returned error: %v (want AcceptedError)", err)
+	}
+
+	want := &Repository{
+		ID:     Int64(1),
+		NodeID: String("R_kgDPP3c6pQ"),
+		Owner: &User{
+			Login:             String("owner"),
+			ID:                Int64(2),
+			NodeID:            String("MDQ6VXFGcjYyMjcyMTQw"),
+			AvatarURL:         String("https://avatars.githubusercontent.com/u/111111?v=4"),
+			HTMLURL:           String("https://github.com/xxxxx"),
+			GravatarID:        String(""),
+			Type:              String("User"),
+			SiteAdmin:         Bool(false),
+			URL:               String("https://api.github.com/users/owner"),
+			EventsURL:         String("https://api.github.com/users/owner/events{/privacy}"),
+			FollowingURL:      String("https://api.github.com/users/owner/following{/other_user}"),
+			FollowersURL:      String("https://api.github.com/users/owner/followers"),
+			GistsURL:          String("https://api.github.com/users/owner/gists{/gist_id}"),
+			OrganizationsURL:  String("https://api.github.com/users/owner/orgs"),
+			ReceivedEventsURL: String("https://api.github.com/users/owner/received_events"),
+			ReposURL:          String("https://api.github.com/users/owner/repos"),
+			StarredURL:        String("https://api.github.com/users/owner/starred{/owner}{/repo}"),
+			SubscriptionsURL:  String("https://api.github.com/users/owner/subscriptions"),
+		},
+		Name:             String("repo-ghsa-xxxx-xxxx-xxxx"),
+		FullName:         String("owner/repo-ghsa-xxxx-xxxx-xxxx"),
+		DefaultBranch:    String("master"),
+		CreatedAt:        &Timestamp{time.Date(2023, time.December, 8, 17, 22, 41, 0, time.UTC)},
+		PushedAt:         &Timestamp{time.Date(2023, time.December, 3, 11, 27, 8, 0, time.UTC)},
+		UpdatedAt:        &Timestamp{time.Date(2023, time.December, 8, 17, 22, 42, 0, time.UTC)},
+		HTMLURL:          String("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx"),
+		CloneURL:         String("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git"),
+		GitURL:           String("git://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git"),
+		SSHURL:           String("git@github.com:owner/repo-ghsa-xxxx-xxxx-xxxx.git"),
+		SVNURL:           String("https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx"),
+		Fork:             Bool(false),
+		ForksCount:       Int(0),
+		NetworkCount:     Int(0),
+		OpenIssuesCount:  Int(0),
+		OpenIssues:       Int(0),
+		StargazersCount:  Int(0),
+		SubscribersCount: Int(0),
+		WatchersCount:    Int(0),
+		Watchers:         Int(0),
+		Size:             Int(0),
+		Permissions: map[string]bool{
+			"admin":    true,
+			"maintain": true,
+			"pull":     true,
+			"push":     true,
+			"triage":   true,
+		},
+		AllowForking:             Bool(true),
+		WebCommitSignoffRequired: Bool(false),
+		Archived:                 Bool(false),
+		Disabled:                 Bool(false),
+		Private:                  Bool(true),
+		HasIssues:                Bool(false),
+		HasWiki:                  Bool(false),
+		HasPages:                 Bool(false),
+		HasProjects:              Bool(false),
+		HasDownloads:             Bool(false),
+		HasDiscussions:           Bool(false),
+		IsTemplate:               Bool(false),
+		URL:                      String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx"),
+		ArchiveURL:               String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/{archive_format}{/ref}"),
+		AssigneesURL:             String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/assignees{/user}"),
+		BlobsURL:                 String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/blobs{/sha}"),
+		BranchesURL:              String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/branches{/branch}"),
+		CollaboratorsURL:         String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/collaborators{/collaborator}"),
+		CommentsURL:              String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/comments{/number}"),
+		CommitsURL:               String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/commits{/sha}"),
+		CompareURL:               String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/compare/{base}...{head}"),
+		ContentsURL:              String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contents/{+path}"),
+		ContributorsURL:          String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contributors"),
+		DeploymentsURL:           String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/deployments"),
+		DownloadsURL:             String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/downloads"),
+		EventsURL:                String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/events"),
+		ForksURL:                 String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/forks"),
+		GitCommitsURL:            String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/commits{/sha}"),
+		GitRefsURL:               String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/refs{/sha}"),
+		GitTagsURL:               String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/tags{/sha}"),
+		HooksURL:                 String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/hooks"),
+		IssueCommentURL:          String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/comments{/number}"),
+		IssueEventsURL:           String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/events{/number}"),
+		IssuesURL:                String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues{/number}"),
+		KeysURL:                  String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/keys{/key_id}"),
+		LabelsURL:                String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/labels{/name}"),
+		LanguagesURL:             String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/languages"),
+		MergesURL:                String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/merges"),
+		MilestonesURL:            String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/milestones{/number}"),
+		NotificationsURL:         String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/notifications{?since,all,participating}"),
+		PullsURL:                 String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/pulls{/number}"),
+		ReleasesURL:              String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/releases{/id}"),
+		StargazersURL:            String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/stargazers"),
+		StatusesURL:              String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/statuses/{sha}"),
+		SubscribersURL:           String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscribers"),
+		SubscriptionURL:          String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscription"),
+		TagsURL:                  String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/tags"),
+		TeamsURL:                 String("https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/teams"),
+		Visibility:               String("private"),
+	}
+	if !cmp.Equal(fork, want) {
+		t.Errorf("SecurityAdvisoriesService.CreateTemporaryPrivateFork returned %+v, want %+v", fork, want)
+	}
+}
+
+func TestSecurityAdvisoriesService_CreateTemporaryPrivateFork_invalidOwner(t *testing.T) {
+	client, _, _, teardown := setup()
+	defer teardown()
+
+	ctx := context.Background()
+	_, _, err := client.SecurityAdvisories.CreateTemporaryPrivateFork(ctx, "%", "r", "ghsa_id")
+	testURLParseError(t, err)
+}
+
 func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg_BadRequest(t *testing.T) {
 	client, mux, _, teardown := setup()
 	defer teardown()
@@ -146,8 +612,8 @@ func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg(t *tes
 		assertWrite(t, w, []byte(`[
 			{
 				"ghsa_id": "GHSA-abcd-1234-efgh",
-   				"cve_id": "CVE-2050-00000"
- 			}
+				"cve_id": "CVE-2050-00000"
+			}
 		]`))
 	})
 
@@ -277,8 +743,8 @@ func TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories(t *testing.T
 		assertWrite(t, w, []byte(`[
 			{
 				"ghsa_id": "GHSA-abcd-1234-efgh",
-   				"cve_id": "CVE-2050-00000"
- 			}
+				"cve_id": "CVE-2050-00000"
+			}
 		]`))
 	})