integrations / terraform-provider-github

Terraform GitHub provider

Home Page:https://www.terraform.io/docs/providers/github/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG]: Importing an internal repo still causes the provider to want to modify visibility from private to internal

martinb3 opened this issue · comments

Expected Behavior

There should be no change.

Actual Behavior

The provider wants to update visibility from "private" to "internal" after refreshing state.

Terraform Version

Terraform 1.5.6

Affected Resource(s)

github_repository

Terraform Configuration Files

resource "github_repository" "main" {
  name        = ...
  description = ...

  visibility = "internal"

Steps to Reproduce

Simply run an import and then apply. Here's the GitHub UI for the internal repo:
Screenshot 2024-04-23 at 11 38 01 AM

Error Output

My organization doesn't allow changing repo visibility, even though it shouldn't need to be done.

Error: PATCH https://api.github.com/repos/my-org/my-repo: 422 Visibility can't be changed by this user. []

Debug Output

No response

Panic Output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct