Skip to content

Commit bb62d7a

Browse files
committed
Fix schemas
1 parent fa0805c commit bb62d7a

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

github/resource_github_organization_ruleset.go

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,10 @@ func resourceGithubOrganizationRuleset() *schema.Resource {
113113
},
114114
},
115115
"repository_property": {
116-
Type: schema.TypeList,
117-
Optional: true,
118-
MaxItems: 1,
119-
ExactlyOneOf: []string{"conditions.0.repository_id"},
120-
AtLeastOneOf: []string{"conditions.0.repository_id"},
121-
Description: "Conditions to target repositories by property ",
116+
Type: schema.TypeList,
117+
Optional: true,
118+
MaxItems: 1,
119+
Description: "Conditions to target repositories by property ",
122120
Elem: &schema.Resource{
123121
Schema: map[string]*schema.Schema{
124122
"include": {
@@ -143,6 +141,7 @@ func resourceGithubOrganizationRuleset() *schema.Resource {
143141
},
144142
"source": {
145143
Type: schema.TypeString,
144+
Optional: true,
146145
Description: "The source of the repository property. Defaults to 'custom' if not specified.Can be one of: custom, system",
147146
Default: "custom",
148147
},
@@ -168,24 +167,27 @@ func resourceGithubOrganizationRuleset() *schema.Resource {
168167
AtLeastOneOf: []string{"conditions.0.repository_id"},
169168
Elem: &schema.Resource{
170169
Schema: map[string]*schema.Schema{
171-
172-
"name": {
173-
Type: schema.TypeString,
170+
"include": {
171+
Type: schema.TypeList,
174172
Required: true,
175-
Description: "The name of the repository property to target",
173+
Description: "Array of repository names or patterns to include. One of these patterns must match for the condition to pass. Also accepts `~ALL` to include all repositories.",
174+
Elem: &schema.Schema{
175+
Type: schema.TypeString,
176+
},
176177
},
177-
"property_values": {
178+
"exclude": {
178179
Type: schema.TypeList,
179180
Required: true,
180-
Description: "The values to match for the repository property.",
181+
Description: "Array of repository names or patterns to exclude. The condition will not pass if any of these patterns match.",
181182
Elem: &schema.Schema{
182183
Type: schema.TypeString,
183184
},
184185
},
185-
"source": {
186-
Type: schema.TypeString,
187-
Description: "The source of the repository property. Defaults to 'custom' if not specified.Can be one of: custom, system",
188-
Default: "custom",
186+
"protected": {
187+
Type: schema.TypeBool,
188+
Optional: true,
189+
Default: false,
190+
Description: "Whether renaming of target repositories is prevented.",
189191
},
190192
},
191193
},

0 commit comments

Comments
 (0)