Skip to content

Commit 0888d58

Browse files
committed
Fix repository_property validation and docs
- Add ValidateFunc to include.source field for consistency with exclude - Update docs to mention repository_property as third targeting option - Fix missing space in documentation
1 parent e3be469 commit 0888d58

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

github/resource_github_organization_ruleset.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,11 @@ func resourceGithubOrganizationRuleset() *schema.Resource {
144144
},
145145
},
146146
"source": {
147-
Type: schema.TypeString,
148-
Optional: true,
149-
Description: "The source of the repository property. Defaults to 'custom' if not specified. Can be one of: custom, system",
150-
Default: "custom",
147+
Type: schema.TypeString,
148+
Optional: true,
149+
Description: "The source of the repository property. Defaults to 'custom' if not specified. Can be one of: custom, system",
150+
Default: "custom",
151+
ValidateFunc: validation.StringInSlice([]string{"custom", "system"}, false),
151152
},
152153
},
153154
},

website/docs/r/organization_ruleset.html.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ The `rules` block supports the following:
310310
- `repository_name` (Optional) (Block List, Max: 1) Conflicts with `repository_id` and `repository_property`. (see [below for nested schema](#conditions.repository_name))
311311
- `repository_property` (Optional) (Block List, Max: 1) Conflicts with `repository_id` and `repository_name`. (see [below for nested schema](#conditions.repository_property))
312312

313-
One of `repository_id` and `repository_name` must be set for the rule to target any repositories.
313+
One of `repository_id`, `repository_name`, or `repository_property` must be set for the rule to target any repositories.
314314

315315
#### conditions.ref_name ####
316316

@@ -328,7 +328,7 @@ One of `repository_id` and `repository_name` must be set for the rule to target
328328

329329
- `include` - (Optional) (List of Repository Properties) The repository properties and values to include. All of these properties must match for the condition to pass. (see [below for nested schema](#conditions.repository_property.properties))
330330

331-
- `exclude` - (Optional) (List of Repository Properties) The repository properties and values to exclude. The condition will not pass if any of these properties match.(see [below for nested schema](#conditions.repository_property.properties))
331+
- `exclude` - (Optional) (List of Repository Properties) The repository properties and values to exclude. The condition will not pass if any of these properties match. (see [below for nested schema](#conditions.repository_property.properties))
332332

333333
#### conditions.repository_property.properties ####
334334

0 commit comments

Comments
 (0)