-
Notifications
You must be signed in to change notification settings - Fork 949
Repository environment creation error #1262
Copy link
Copy link
Closed
Labels
Status: 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 documented
Description
Terraform Version
Terraform v1.0.7
Affected Resource(s)
github_repository_environment
Terraform Configuration Files
resource "github_repository_environment" "my_repo_environments" {
for_each = toset([
"production",
"staging",
])
repository = github_repository.my_repo.name
environment = each.key
}Debug Output
Expected Behavior
Create an environment
Actual Behavior
Got this errore (both staging and production)
╷
│ Error: PUT https://api.github.com/repos/my-org/my-repo/environments/production: 422 Fail to create protected rule, please ensure billing plan include protected branch gate. []
│
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
Work arround
If I set the "Deployment branches" in the GUI (protected branches), import the resource and add the following config terraform terminates well.
deployment_branch_policy {
protected_branches = true
custom_branch_policies = false
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Status: 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 documented