Skip to content

Commit 9dd2965

Browse files
committed
Fix condition to require only one of repository_name or repository_id
Signed-off-by: Timo Sand <[email protected]>
1 parent 4863750 commit 9dd2965

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

github/resource_github_organization_ruleset.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ func validateConditionsFieldForBranchAndTagTargets(ctx context.Context, d *schem
730730
if conditions["ref_name"] == nil || len(conditions["ref_name"].([]any)) == 0 {
731731
return fmt.Errorf("ref_name must be set for %s target", target)
732732
}
733-
if conditions["repository_name"] == nil || len(conditions["repository_name"].([]any)) == 0 || conditions["repository_id"] == nil || len(conditions["repository_id"].([]any)) == 0 {
733+
if (conditions["repository_name"] == nil || len(conditions["repository_name"].([]any)) == 0) && (conditions["repository_id"] == nil || len(conditions["repository_id"].([]any)) == 0){
734734
return fmt.Errorf("Either repository_name or repository_id must be set for %s target", target)
735735
}
736736
return nil

0 commit comments

Comments
 (0)