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

Code before:
//
//meta:operation POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses
func (s *SecretScanningService) PushProtectionBypasses(ctx context.Context, owner, repo string, opts *CreatePushProtectionBypass) (*PushProtectionBypass, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/secret-scanning/push-protection-bypasses", owner, repo)

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

// ScanHistory 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) ScanHistory(ctx context.Context, owner, repo string) (*SecretScanningResponse, *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 *SecretScanningResponse
	resp, err := s.client.Do(ctx, req, &secretScanningHistory)
	if err != nil {
		return nil, resp, err
	}

	return secretScanningHistory, resp, nil
}


Review comment (security):
```suggestion
func (s *SecretScanningService) GetScanHistory(ctx context.Context, owner, repo string) (*SecretScanningResponse, *Response, error) {
```

Code after:
	}

	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
	}