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

Code before:

// 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)

	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
	}

	return resp, nil
}

// DisableRepositoryForImmutableRelease disable a selected repository for immutable releases in an organization.
//
// To remove a repository from 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#disable-a-selected-repository-for-immutable-releases-in-an-organization
//
//meta:operation DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}
func (s *OrganizationsService) DisableRepositoryForImmutableRelease(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("DELETE", u, nil)
	if err != nil {
		return nil, err
	}

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

	return resp, nil
}


Review comment (suggestion):
```suggestion
// DisableRepositoryForImmutableRelease disables a selected repository for immutable releases in an organization.
```

Code after:

	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
	}

	return resp, nil
}

// DisableRepositoryForImmutableRelease removes a repository from the organization's selected list for immutable releases enforcement.
// It requires enforced_repositories to be set to "selected".
//
// GitHub API docs: https://docs.github.com/rest/orgs/orgs#disable-a-selected-repository-for-immutable-releases-in-an-organization
//
//meta:operation DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}
func (s *OrganizationsService) DisableRepositoryForImmutableRelease(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("DELETE", u, nil)
	if err != nil {
		return nil, err
	}

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

	return resp, nil
}