Expected Behavior
The provider should allow required_workflows with zero required_workflow sub-blocks, matching the behavior of the GitHub UI and API:
resource "github_organization_ruleset" "example" {
name = "strict-master"
target = "branch"
enforcement = "active"
conditions {
ref_name {
include = ["~DEFAULT_BRANCH"]
exclude = []
}
repository_name {
include = ["~ALL"]
exclude = []
}
}
rules {
required_workflows {
do_not_enforce_on_create = false
# No required_workflow blocks — should be valid
}
}
}
Actual Behavior
Error: Insufficient required_workflow blocks
on main.tf line XX, in resource "github_organization_ruleset" "example":
At least 1 "required_workflow" blocks are required.
Terraform Version
Terraform v1.5.7
on darwin_arm64
- provider registry.terraform.io/integrations/github v6.11.1
Affected Resource(s)
github_organization_ruleset
github_repository_ruleset
Terraform Configuration Files
Steps to Reproduce
- In the GitHub UI, create an organization ruleset
- Enable "Require workflows to pass" without adding any specific workflows
- Attempt to import or recreate this ruleset in Terraform
Debug Output
Panic Output
Code of Conduct