Skip to content

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

@jtgrohn

Description

@jtgrohn

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions