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

Code before:
		return nil, nil, err
	}

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

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

	return repositories, resp, nil
}

// SetImmutableReleaseRepositories sets selected repositories for immutable releases enforcement.
//
// This endpoint replaces all repositories that have been selected for immutable releases enforcement in an organization.
// To use this endpoint, the organization immutable releases policy for enforced_repositories must be configured to selected.
//
// GitHub API docs: https://docs.github.com/rest/orgs/orgs#set-selected-repositories-for-immutable-releases-enforcement
//
//meta:operation PUT /orgs/{org}/settings/immutable-releases/repositories
func (s *OrganizationsService) SetImmutableReleaseRepositories(ctx context.Context, org string, opts *SelectedRepositories) (*Response, error) {
	u := fmt.Sprintf("orgs/%v/settings/immutable-releases/repositories", org)

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

	resp, err := s.client.Do(ctx, req, nil)
	if err != nil {
		return resp, err
	}

	return resp, nil
}

// EnableRepositoryForImmutableRelease enable a selected repository for immutable releases in an organization.
//
// To add a repository to the list of selected repositories that are enforced for immutable releases in an organization.
// To use this endpoint, the organization immutable releases policy for enforced_repositories must be configured to selected.
//
// GitHub API docs: https://docs.github.com/rest/orgs/orgs#enable-a-selected-repository-for-immutable-releases-in-an-organization
//
//meta:operation PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}
func (s *OrganizationsService) EnableRepositoryForImmutableRelease(ctx context.Context, org string, repoID int64) (*Response, error) {
	u := fmt.Sprintf("orgs/%v/settings/immutable-releases/repositories/%v", org, repoID)

Review comment (suggestion):
```suggestion
func (s *OrganizationsService) SetImmutableReleaseRepositories(ctx context.Context, org string, opts SelectedRepositories) (*Response, error) {
```

Code after:
		return nil, resp, err
	}

	return repositories, resp, nil
}

// SetImmutableReleaseRepositories sets selected repositories for immutable releases enforcement.
// It requires the organization's immutable releases policy for enforced_repositories to be set to "selected".
//
// GitHub API docs: https://docs.github.com/rest/orgs/orgs#set-selected-repositories-for-immutable-releases-enforcement
//
//meta:operation PUT /orgs/{org}/settings/immutable-releases/repositories
func (s *OrganizationsService) SetImmutableReleaseRepositories(ctx context.Context, org string, repositoryIDs []int64) (*Response, error) {
	u := fmt.Sprintf("orgs/%v/settings/immutable-releases/repositories", org)

	body := &setImmutableReleasesRepositoriesOptions{
		SelectedRepositoryIDs: repositoryIDs,
	}

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

	resp, err := s.client.Do(ctx, req, nil)
	if err != nil {
		return resp, err
	}

	return resp, nil
}

// EnableRepositoryForImmutableRelease enables a selected repository for immutable releases in an organization.
// It requires enforced_repositories to be set to "selected".
//
// GitHub API docs: https://docs.github.com/rest/orgs/orgs#enable-a-selected-repository-for-immutable-releases-in-an-organization
//
//meta:operation PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}
func (s *OrganizationsService) EnableRepositoryForImmutableRelease(ctx context.Context, org string, repoID int64) (*Response, error) {
	u := fmt.Sprintf("orgs/%v/settings/immutable-releases/repositories/%v", org, repoID)

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

	resp, err := s.client.Do(ctx, req, nil)
	if err != nil {
		return resp, err
	}