Skip to content
Closed
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 @@ -465,6 +465,12 @@ func resourceGithubOrganizationRuleset() *schema.Resource {
},
},
},
"do_not_enforce_on_create": {
Type: schema.TypeBool,
Optional: true,
Default: false,
Description: "Whether or not to allow repository and branch creation without the required workflows passing.",
},
},
},
},
Expand Down
7 changes: 0 additions & 7 deletions github/resource_github_organization_ruleset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ func TestGithubOrganizationRulesets(t *testing.T) {
randomID := acctest.RandStringFromCharSet(5, acctest.CharSetAlphaNum)

t.Run("Creates and updates organization rulesets without errors", func(t *testing.T) {

config := fmt.Sprintf(`
resource "github_organization_ruleset" "test" {
name = "test-%s"
Expand Down Expand Up @@ -150,11 +149,9 @@ func TestGithubOrganizationRulesets(t *testing.T) {
t.Run("with an enterprise account", func(t *testing.T) {
testCase(t, enterprise)
})

})

t.Run("Updates a ruleset name without error", func(t *testing.T) {

oldRSName := fmt.Sprintf(`ruleset-%[1]s`, randomID)
newRSName := fmt.Sprintf(`%[1]s-renamed`, randomID)

Expand Down Expand Up @@ -209,11 +206,9 @@ func TestGithubOrganizationRulesets(t *testing.T) {
t.Run("with an enterprise account", func(t *testing.T) {
testCase(t, enterprise)
})

})

t.Run("Imports rulesets without error", func(t *testing.T) {

config := fmt.Sprintf(`
resource "github_organization_ruleset" "test" {
name = "test-%s"
Expand Down Expand Up @@ -292,7 +287,5 @@ func TestGithubOrganizationRulesets(t *testing.T) {
t.Run("with an enterprise account", func(t *testing.T) {
testCase(t, enterprise)
})

})

}
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 @@ -178,6 +178,8 @@ The `rules` block supports the following:

* `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))

* `do_not_enforce_on_create` - (Optional) (Boolean) Whether or not to allow repository and branch creation without the required workflows passing.

#### rules.required_workflows.required_workflow ####

* `repository_id` - (Required) (Number) The ID of the repository. Names, full names and repository URLs are not supported.
Expand Down