Repository: google/go-github
File: github/secret_scanning.go (Go)

Code before:
	}

	return locations, resp, nil
}

// CreatePushProtectionBypass creates a push protection bypass for a given repository.
//
// To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with
// the repo scope or security_events scope.
//
// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#create-a-push-protection-bypass
//
//meta:operation POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses
func (s *SecretScanningService) CreatePushProtectionBypass(ctx context.Context, owner, repo string, request PushProtectionBypassRequest) (*PushProtectionBypass, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/secret-scanning/push-protection-bypasses", owner, repo)

	req, err := s.client.NewRequest("POST", u, request)
	if err != nil {
		return nil, nil, err
	}
	var responsePushProtectionBypass *PushProtectionBypass
	resp, err := s.client.Do(ctx, req, &responsePushProtectionBypass)
	if err != nil {
		return nil, resp, err
	}
	return responsePushProtectionBypass, resp, nil
}

// GetScanHistory fetches the secret scanning history for a given repository.
//
// To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with
// the repo scope or security_events scope and gitHub advanced security or secret scanning must be enabled.
//
// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#get-secret-scanning-scan-history-for-a-repository
//
//meta:operation GET /repos/{owner}/{repo}/secret-scanning/scan-history
func (s *SecretScanningService) GetScanHistory(ctx context.Context, owner, repo string) (*SecretScanningHistory, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/secret-scanning/scan-history", owner, repo)

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	var secretScanningHistory *SecretScanningHistory
	resp, err := s.client.Do(ctx, req, &secretScanningHistory)
	if err != nil {
		return nil, resp, err
	}

	return secretScanningHistory, resp, nil

Review comment (suggestion):
We should be consistent with the rest code in the file:

```suggestion

	var pushProtectionBypass *PushProtectionBypass
	resp, err := s.client.Do(ctx, req, &pushProtectionBypass)
	if err != nil {
		return nil, resp, err
	}

	return pushProtectionBypass, resp, nil
```

Code after:
		return nil, resp, err
	}

	return locations, resp, nil
}

// CreatePushProtectionBypass creates a push protection bypass for a given repository.
//
// To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with
// the repo scope or security_events scope.
//
// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#create-a-push-protection-bypass
//
//meta:operation POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses
func (s *SecretScanningService) CreatePushProtectionBypass(ctx context.Context, owner, repo string, request PushProtectionBypassRequest) (*PushProtectionBypass, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/secret-scanning/push-protection-bypasses", owner, repo)

	req, err := s.client.NewRequest("POST", u, request)
	if err != nil {
		return nil, nil, err
	}

	var pushProtectionBypass *PushProtectionBypass
	resp, err := s.client.Do(ctx, req, &pushProtectionBypass)
	if err != nil {
		return nil, resp, err
	}
	return pushProtectionBypass, resp, nil
}

// GetScanHistory fetches the secret scanning history for a given repository.
//
// To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with
// the repo scope or security_events scope and gitHub advanced security or secret scanning must be enabled.
//
// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#get-secret-scanning-scan-history-for-a-repository
//
//meta:operation GET /repos/{owner}/{repo}/secret-scanning/scan-history
func (s *SecretScanningService) GetScanHistory(ctx context.Context, owner, repo string) (*SecretScanningScanHistory, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/secret-scanning/scan-history", owner, repo)

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	var secretScanningHistory *SecretScanningScanHistory
	resp, err := s.client.Do(ctx, req, &secretScanningHistory)
	if err != nil {
		return nil, resp, err
	}