Skip to content

feat: add github_repository_immutable_releases resource - #3701

Open
pascalinthecloud wants to merge 2 commits into
integrations:mainfrom
pascalinthecloud:feat/repository-immutable-releases
Open

pascalinthecloud wants to merge 2 commits into
integrations:mainfrom
pascalinthecloud:feat/repository-immutable-releases

Conversation

@pascalinthecloud

Copy link
Copy Markdown

Resolves #2746


Before the change?

  • Immutable releases could not be managed for a repository.

After the change?

  • New github_repository_immutable_releases resource. It is a separate resource rather than a github_repository attribute because the setting has its own endpoints.
  • Uses the rename-safe repository / repository_id / diffRepository pattern, so renaming the repository updates in place.
  • GitHub documents a 404 from GET /repos/{owner}/{repo}/immutable-releases when the feature is disabled, but it currently returns 200 {"enabled": false}. On a 404, Read looks the repository up and only drops the resource from state if the repository is gone, so it works with either behaviour.

Testing: TestAccGithubRepositoryImmutableReleases passes in organization mode. I also applied it manually with a local build: a release published afterwards returns "immutable": true, and a re-plan shows no drift.

The org-level setting is handled separately in #3227.

This PR was written with help from an AI coding assistant. I have reviewed and tested the changes.

Pull request checklist

  • Schema migrations have been created if needed (example)
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes
  • No

Manage immutable releases for a repository through the dedicated
/repos/{owner}/{repo}/immutable-releases endpoints.

GitHub documents a 404 from the status endpoint when immutable releases
are disabled, although it currently returns enabled=false. Read looks the
repository up on 404 so the resource is only removed from state when the
repository itself is gone.

Refs integrations#2746
@github-actions

Copy link
Copy Markdown

👋 Hi, and thank you for this contribution!

This repo is maintained by GitHub and community members on a best-effort basis. We'll get to this as soon as we can.

You can help us prioritize by joining the discussion on open issues and PRs, sharing details on the changes you need, and reviewing other contributions.


🤖 This is an automated message.

@github-actions github-actions Bot added the Type: Feature New feature or request label Oct 24, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT]: Support immutable release in github_repository

1 participant