terraform-provider-github
terraform-provider-github copied to clipboard
Keep visibility setting on repository creation
This fixes #580
As stated in the issue the statement in the comment is incorrect as you do not need to be an owner to create a repository in an organization but you need to be an owner to change the visibility of an already existing repository. Hence the update is failing.
Happy to get any feedback on this.
The change here results in a 422
when creating a private repository:
=== RUN TestAccGithubRepositories/creates_and_updates_repositories_without_error/with_an_individual_account
TestAccGithubRepositories/creates_and_updates_repositories_without_error/with_an_individual_account: testing.go:654: Step 0 error: errors during apply:
Error: PATCH https://api.github.com/repos/terraformtesting/tf-acc-test-public-qpkje: 422 Visibility is already private. []
on /var/folders/t1/p9cyhv6s2wg4g8s_x6zkpz_m0000gn/T/tf-test521965715/main.tf line 2:
(source code not available)
resource "github_repository" "test" {
name = "tf-acc-test-create-%[1]s"
description = "Terraform acceptance tests %[1]s"
visibility = "private"
}
🤔 we may have to make more invasive changes around the whole create-then-update sequence we're building on. Will post some ideas over in https://github.com/terraform-providers/terraform-provider-github/issues/580 before returning to this implementation.
👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!
👋 Hey Friends, this pull request has been automatically marked as stale
because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned
label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!