Hi there,
Terraform Version
1.0.5
Affected Resource(s)
Terraform Configuration Files
# create github repository for the domain under domain team
resource "github_repository" "domain" {
name = lower("${var.domain}-domain")
visibility = "internal"
template {
owner = "our-enterprise-org-id"
repository = "tf-domain-template"
}
}
Debug Output
Gist: https://gist.github.com/damir-dezeljin/e9de28e11aa7de8d7a60fc2e123794f6
NOTE: I removed the sensible parts from the logs. Still, I think the logs shows what's the actual issue. Let me recap it here:
- We're using TF to create a GitHub repo out of a template.
- The template repo visibility is set to
Internal.
- The newly created repo visibility should be
Internal as well.
- The repo gets created, but it remains
Private and the visibility setup phase fails with error 422.
Panic Output
n/a
Expected Behavior
I'd expect a new repo with visibility Internal being created.
Actual Behavior
The terraform apply fails with error code 422 on visibility change step.
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
- Set org policy to prevent users from changing repos visibility.
- Create a template repo with visibility
Internal
- Use the provided TF code for creating a new repo with visibility
Internal out of the template one.
- Use a GitHub App identity with scopes listed below.
- Run
terraform apply.
Important Factoids
- We're running TF with GitHub Apps credentials with following scopes:
- Repository access: All repositories
- Repository permissions:
- Administration: r/w
- Contents: r/w
- Metadata: ro
- Secrets: r/w
- Organization permissions:
- Members: r/w
- Administration: r/w
- Our Enterprise has an Org.Policy set that prevents users from creating Public repos, as well only Org.Owners are allowed to change repos visibility.
References
n/a
Hi there,
Terraform Version
1.0.5Affected Resource(s)
Terraform Configuration Files
Debug Output
Gist: https://gist.github.com/damir-dezeljin/e9de28e11aa7de8d7a60fc2e123794f6
NOTE: I removed the sensible parts from the logs. Still, I think the logs shows what's the actual issue. Let me recap it here:
Internal.Internalas well.Privateand the visibility setup phase fails with error 422.Panic Output
n/a
Expected Behavior
I'd expect a new repo with visibility
Internalbeing created.Actual Behavior
The
terraform applyfails with error code422on visibility change step.Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
InternalInternalout of the template one.terraform apply.Important Factoids
References
n/a