Skip to content

Commit dafc3d6

Browse files
committed
Apply suggestions from PR comment
1 parent 8002e8a commit dafc3d6

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

github/resource_github_organization_ruleset.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func resourceGithubOrganizationRuleset() *schema.Resource {
164164
"exclude": {
165165
Type: schema.TypeList,
166166
Optional: true,
167-
Description: "The repository properties and values to exclude. The condition will not pass if any of these properties match.",
167+
Description: "The repository properties and values to exclude. The ruleset will not apply if any of these properties match.",
168168
Elem: &schema.Resource{
169169
Schema: map[string]*schema.Schema{
170170
"name": {
@@ -232,7 +232,7 @@ func resourceGithubOrganizationRuleset() *schema.Resource {
232232
Optional: true,
233233
ExactlyOneOf: []string{"conditions.0.repository_property", "conditions.0.repository_name", "conditions.0.repository_id"},
234234
AtLeastOneOf: []string{"conditions.0.repository_property", "conditions.0.repository_name", "conditions.0.repository_id"},
235-
Description: "The repository IDs that the ruleset applies to. One of these IDs must match for the condition to pass.",
235+
Description: "The repository IDs that the ruleset applies to. One of these IDs must match for the ruleset to apply.",
236236
Elem: &schema.Schema{
237237
Type: schema.TypeInt,
238238
},

github/util_ruleset_validation.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,7 @@ func validateConditionsFieldForBranchAndTagTargets(ctx context.Context, target g
171171
return fmt.Errorf("ref_name must be set for %s target", target)
172172
}
173173

174-
// Repository rulesets don't have repository_name, repository_id, or repository_property - only org rulesets do.
175-
// Note: The built-in ExactlyOneOf/AtLeastOneOf schema validation already ensures exactly one
176-
// repository targeting option is set, so no additional validation is needed here.
174+
177175
tflog.Debug(ctx, fmt.Sprintf("Conditions validation passed for %s target", target))
178176
return nil
179177
}

website/docs/r/organization_ruleset.html.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,9 @@ Exactly one of `repository_id`, `repository_name`, or `repository_property` must
384384

385385
#### conditions.repository_property ####
386386

387-
- `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))
387+
- `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](#conditionsrepository_propertyproperties))
388388

389-
- `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))
389+
- `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](#conditionsrepository_propertyproperties))
390390

391391
#### conditions.repository_property.properties ####
392392

0 commit comments

Comments
 (0)