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

Code before:
}

// UpdateImmutableReleasesSettings sets immutable releases settings for an organization.
//
// GitHub API docs: https://docs.github.com/rest/orgs/orgs#set-immutable-releases-settings-for-an-organization
//
//meta:operation PUT /orgs/{org}/settings/immutable-releases
func (s *OrganizationsService) UpdateImmutableReleasesSettings(ctx context.Context, org string, opts ImmutableReleaseRepository) (*Response, error) {
	u := fmt.Sprintf("orgs/%v/settings/immutable-releases", 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
}

// ListImmutableReleaseRepositories lists selected repositories for immutable releases enforcement.
//
// This endpoint gives a list of all the repositories that have been selected for immutable releases enforcement in an organization.
//
// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-selected-repositories-for-immutable-releases-enforcement
//
//meta:operation GET /orgs/{org}/settings/immutable-releases/repositories
func (s *OrganizationsService) ListImmutableReleaseRepositories(ctx context.Context, org string, opts *ListOptions) (*ListRepositories, *Response, error) {
	u := fmt.Sprintf("orgs/%v/settings/immutable-releases/repositories", org)

	u, err := addOptions(u, opts)
	if err != nil {
		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
}

Review comment (suggestion):
```suggestion
// ListImmutableReleaseRepositories lists selected repositories for immutable releases enforcement in an organization.
```

Code after:
// UpdateImmutableReleasesSettings sets immutable releases settings for an organization.
//
// GitHub API docs: https://docs.github.com/rest/orgs/orgs#set-immutable-releases-settings-for-an-organization
//
//meta:operation PUT /orgs/{org}/settings/immutable-releases
func (s *OrganizationsService) UpdateImmutableReleasesSettings(ctx context.Context, org string, opts ImmutableReleasePolicy) (*Response, error) {
	u := fmt.Sprintf("orgs/%v/settings/immutable-releases", 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
}

// ListImmutableReleaseRepositories lists selected repositories for immutable releases enforcement in an organization.
//
// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-selected-repositories-for-immutable-releases-enforcement
//
//meta:operation GET /orgs/{org}/settings/immutable-releases/repositories
func (s *OrganizationsService) ListImmutableReleaseRepositories(ctx context.Context, org string, opts *ListOptions) (*ListRepositories, *Response, error) {
	u := fmt.Sprintf("orgs/%v/settings/immutable-releases/repositories", org)

	u, err := addOptions(u, opts)
	if err != nil {
		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.
// It requires the organization's immutable releases policy for enforced_repositories to be set to "selected".
//