-
Notifications
You must be signed in to change notification settings - Fork 904
Closed
Labels
Description
Terraform Version
0.15.3
Provider Version
terraform {
required_providers {
github = "4.9.4"
}
Affected Resource(s)
Please list the resources as a list, for example:
github_repository
Terraform Configuration Files
resource "github_repository" "test_repo" {
name = "test_repo"
visibility = "internal"
}Debug Output
│ Error: PATCH https://api.github.com/repos/rtkwlf/test_repo: 422 Visibility can't be changed by this user. []
│
│ with github_repository.test_repo,
│ on repositories.tf line 31, in resource "github_repository" "test_repo":
│ 31: resource "github_repository" "test_repo" {
Expected Behavior
The repository should have been created with internal visibility
Actual Behavior
The repository was created with private visibility. Switching it to internal visibility failed.
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
Important Factoids
Our GitHub Organization only allows Administrators to change repository visibility and we want the terraform to be executable by non-administrator users
References
- PR [fix issue that prevents 'internal' repositories being created in an Enterprise Managed User organisation #781] added the ability to create
internalrepositories in GHE organizations, but I suspect was only tested by an administrator or in an organization where non-administrator users can change repository visibility
dininski, Adam-McDevitt, cstavro, nathanielram, pmjacinto and 14 more
