terraform-provider-github: Unable to create Organization repos in GHE

Terraform Version

Terraform v0.14.4
+ provider registry.terraform.io/hashicorp/github v4.3.0
+ provider registry.terraform.io/integrations/github v4.3.0

Affected Resource(s)

  • github_repository

Terraform Configuration Files

provider "github" {
  organization = "myorgname"
  token        = "**************************"
  base_url     = "https://github.enterprise.instance/"
}

resource "github_repository" "this" {
  name         = "shouldbeinorg"
  description  = "shouldbeinorg"

}

Expected Behavior

Repository should be created in the organization and not the account of the PAT.

Actual Behavior

Repository is created under the user associated with the PAT i.e. not in the org.

Steps to Reproduce

  1. terraform apply

Important Factoids

Just to be clear this is for GitHub Enterprise, I’ve not verified behaviour in github.com

References

This is possibly a similiar issue - https://github.com/integrations/terraform-provider-github/issues/639

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 6
  • Comments: 21

Most upvoted comments

After #735 , below warning appears even when organization is not defined in provider configuration Warning: "organization": [DEPRECATED] Use owner (or GITHUB_OWNER) instead of organization (or GITHUB_ORGANIZATION)