diff --git a/github/resource_github_organization_ruleset.go b/github/resource_github_organization_ruleset.go index 014b28ef65..68743d5a43 100644 --- a/github/resource_github_organization_ruleset.go +++ b/github/resource_github_organization_ruleset.go @@ -261,6 +261,12 @@ func resourceGithubOrganizationRuleset() *schema.Resource { Optional: true, Description: "Whether pull requests targeting a matching branch must be tested with the latest code. This setting will not take effect unless at least one status check is enabled. Defaults to `false`.", }, + "do_not_enforce_on_create": { + Type: schema.TypeBool, + Optional: true, + Description: "Allow repositories and branches to be created if a check would otherwise prohibit it.", + Default: false, + }, }, }, }, diff --git a/github/resource_github_organization_ruleset_test.go b/github/resource_github_organization_ruleset_test.go index 9aae9f35b9..e87cf7c6a9 100644 --- a/github/resource_github_organization_ruleset_test.go +++ b/github/resource_github_organization_ruleset_test.go @@ -60,6 +60,7 @@ func TestGithubOrganizationRulesets(t *testing.T) { } strict_required_status_checks_policy = true + do_not_enforce_on_create = true } required_workflows { @@ -218,6 +219,7 @@ func TestGithubOrganizationRulesets(t *testing.T) { } strict_required_status_checks_policy = true + do_not_enforce_on_create = true } branch_name_pattern { diff --git a/website/docs/r/organization_ruleset.html.markdown b/website/docs/r/organization_ruleset.html.markdown index 1f31a19b42..3dd9139229 100644 --- a/website/docs/r/organization_ruleset.html.markdown +++ b/website/docs/r/organization_ruleset.html.markdown @@ -161,6 +161,8 @@ The `rules` block supports the following: * `integration_id` - (Optional) (Number) The optional integration ID that this status check must originate from. +* `do_not_enforce_on_create` - (Optional) (Boolean) Allow repositories and branches to be created if a check would otherwise prohibit it. Defaults to `false`. + #### rules.required_workflows #### * `required_workflow` - (Required) (Block Set, Min: 1) Actions workflows that are required. Multiple can be defined. (see [below for nested schema](#rules.required_workflows.required_workflow))