Skip to content

Commit 50cff28

Browse files
committed
fix: copilot issues
Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
1 parent 709fbb1 commit 50cff28

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

policies/gh_org_owner_count.rego

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ violation[{"id": "owners_missing"}] if {
7474
not "owners" in object.keys(input)
7575
}
7676

77+
violation[{"id": "owners_missing"}] if {
78+
count(_owners) == 0
79+
}
80+
7781
violation[{"id": "too_many_owners"}] if {
7882
count(_owners) > 5
7983
}

policies/gh_org_owner_count_test.rego

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,9 @@ test_owner_count_exceeded if {
3838
test_owner_count_missing_owners if {
3939
count(violation) > 0 with input as {}
4040
}
41+
42+
test_owner_count_empty_owners if {
43+
count(violation) > 0 with input as {
44+
"owners": []
45+
}
46+
}

0 commit comments

Comments
 (0)