Skip to content

Commit

Permalink
Fix schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
Moser-ss committed Aug 20, 2024
1 parent fa0805c commit bb62d7a
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions github/resource_github_organization_ruleset.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,10 @@ func resourceGithubOrganizationRuleset() *schema.Resource {
},
},
"repository_property": {
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
ExactlyOneOf: []string{"conditions.0.repository_id"},
AtLeastOneOf: []string{"conditions.0.repository_id"},
Description: "Conditions to target repositories by property ",
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
Description: "Conditions to target repositories by property ",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"include": {
Expand All @@ -143,6 +141,7 @@ func resourceGithubOrganizationRuleset() *schema.Resource {
},
"source": {
Type: schema.TypeString,
Optional: true,
Description: "The source of the repository property. Defaults to 'custom' if not specified.Can be one of: custom, system",
Default: "custom",
},
Expand All @@ -168,24 +167,27 @@ func resourceGithubOrganizationRuleset() *schema.Resource {
AtLeastOneOf: []string{"conditions.0.repository_id"},
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{

"name": {
Type: schema.TypeString,
"include": {
Type: schema.TypeList,
Required: true,
Description: "The name of the repository property to target",
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.",
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
"property_values": {
"exclude": {
Type: schema.TypeList,
Required: true,
Description: "The values to match for the repository property.",
Description: "Array of repository names or patterns to exclude. The condition will not pass if any of these patterns match.",
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
"source": {
Type: schema.TypeString,
Description: "The source of the repository property. Defaults to 'custom' if not specified.Can be one of: custom, system",
Default: "custom",
"protected": {
Type: schema.TypeBool,
Optional: true,
Default: false,
Description: "Whether renaming of target repositories is prevented.",
},
},
},
Expand Down

0 comments on commit bb62d7a

Please sign in to comment.