Skip to content

Adds do_not_enforce_on_create option for github_repository_ruleset #2667

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions github/resource_github_organization_ruleset.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
},
},
Expand Down
2 changes: 2 additions & 0 deletions github/resource_github_organization_ruleset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func TestGithubOrganizationRulesets(t *testing.T) {
}

strict_required_status_checks_policy = true
do_not_enforce_on_create = true
}

required_workflows {
Expand Down Expand Up @@ -218,6 +219,7 @@ func TestGithubOrganizationRulesets(t *testing.T) {
}

strict_required_status_checks_policy = true
do_not_enforce_on_create = true
}

branch_name_pattern {
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/organization_ruleset.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down