@@ -165,37 +165,6 @@ func Test_validateConditionsFieldForBranchAndTagTargets(t *testing.T) {
165165 expectError : true ,
166166 errorMsg : "ref_name must be set for branch target" ,
167167 },
168- {
169- name : "invalid branch target without repository_name or repository_id" ,
170- target : github .RulesetTargetBranch ,
171- conditions : map [string ]any {
172- "ref_name" : []any {map [string ]any {"include" : []any {"~DEFAULT_BRANCH" }, "exclude" : []any {}}},
173- },
174- expectError : true ,
175- errorMsg : "either repository_name or repository_id must be set for branch target" ,
176- },
177- {
178- name : "invalid tag target with nil repository_name and repository_id" ,
179- target : github .RulesetTargetTag ,
180- conditions : map [string ]any {
181- "ref_name" : []any {map [string ]any {"include" : []any {"v*" }, "exclude" : []any {}}},
182- "repository_name" : nil ,
183- "repository_id" : nil ,
184- },
185- expectError : true ,
186- errorMsg : "either repository_name or repository_id must be set for tag target" ,
187- },
188- {
189- name : "invalid branch target with empty repository_name and repository_id slices" ,
190- target : github .RulesetTargetBranch ,
191- conditions : map [string ]any {
192- "ref_name" : []any {map [string ]any {"include" : []any {"~DEFAULT_BRANCH" }, "exclude" : []any {}}},
193- "repository_name" : []any {},
194- "repository_id" : []any {},
195- },
196- expectError : true ,
197- errorMsg : "either repository_name or repository_id must be set for branch target" ,
198- },
199168 }
200169
201170 for _ , tt := range tests {
0 commit comments