Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only administrators can create internal repositories in organizations that restrict changing repository visibility to administrators #788

Closed
jtgrohn opened this issue May 17, 2021 · 3 comments
Labels
r/repository Type: Bug Something isn't working as documented

Comments

@jtgrohn
Copy link
Contributor

jtgrohn commented May 17, 2021

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:

  1. 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

image

References

@ingledl
Copy link

ingledl commented Jun 24, 2021

I'd like to see this corrected as well as our org only allows internal repository creation by its members. Creating a private repo and then switching its visibility will both be blocked with our currently configured settings.

@ingledl
Copy link

ingledl commented Jul 1, 2021

This is resolved with release 4.12.1. We have verified it as working in our org. I recommend closing the ticket.

@jcudit jcudit closed this as completed Jul 2, 2021
@dimisjim
Copy link

The problem still persists when trying to change visibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
r/repository Type: Bug Something isn't working as documented
Projects
None yet
Development

No branches or pull requests

4 participants