From 7def0103afe7f0468c086373df6b572dbb6c2c2c Mon Sep 17 00:00:00 2001 From: nenosrep <130157786+nenosrep@users.noreply.github.com> Date: Thu, 22 May 2025 07:26:21 +0200 Subject: [PATCH 1/3] Add do_not_enforce_on_create option for github_organization_ruleset What: Expand schema with missing option do_not_enforce_on_create Why: It is available for github_repository_ruleset and the API --- github/resource_github_organization_ruleset.go | 6 ++++++ 1 file changed, 6 insertions(+) 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, + }, }, }, }, From 672a0f554282b7c023151ccbcacee9d5b719a9c2 Mon Sep 17 00:00:00 2001 From: nenosrep <130157786+nenosrep@users.noreply.github.com> Date: Thu, 22 May 2025 08:31:09 +0200 Subject: [PATCH 2/3] Add do_not_enforce_on_create to github_organization_ruleset test What: Expand test for github_organization_ruleset with do_not_enforce_on_create Why: To ensure that the do_not_enforce_on_create option is working --- github/resource_github_organization_ruleset_test.go | 2 ++ 1 file changed, 2 insertions(+) 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 { From d61737d69ed1b736133797452af1ee95cba83774 Mon Sep 17 00:00:00 2001 From: nenosrep <130157786+nenosrep@users.noreply.github.com> Date: Thu, 22 May 2025 08:49:43 +0200 Subject: [PATCH 3/3] Add do_not_enforce_on_create to github_organization_ruleset docs What: Explain do_not_enforce_on_create option and default vaules in the documentation for the github_organization_ruleset resource Why: Keep the documentation consistent with the implementation --- website/docs/r/organization_ruleset.html.markdown | 2 ++ 1 file changed, 2 insertions(+) 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))