-
Notifications
You must be signed in to change notification settings - Fork 949
Failed setting visibility=internal on a newly created repo from template #925
Copy link
Copy link
Closed
Labels
Status: PinnedA way to keep old or long lived issues aroundA way to keep old or long lived issues aroundStatus: Up for grabsIssues that are ready to be worked on by anyoneIssues that are ready to be worked on by anyoneType: BugSomething isn't working as documentedSomething isn't working as documentedVisibility
Milestone
Description
Hi there,
Terraform Version
1.0.5
Affected Resource(s)
- github_repository
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
Internalas well. - The repo gets created, but it remains
Privateand 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
Internalout 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Status: PinnedA way to keep old or long lived issues aroundA way to keep old or long lived issues aroundStatus: Up for grabsIssues that are ready to be worked on by anyoneIssues that are ready to be worked on by anyoneType: BugSomething isn't working as documentedSomething isn't working as documentedVisibility
Type
Projects
Status
Done