Skip to content

Commit e1db982

Browse files
Vlad Rusuvladioanr
authored andcommitted
feat: only allow tf-dev and tf-prod cluster
Filter out any cluster that does not match the official naming convention tf-dev-* and tf-prod-*
1 parent 6e10069 commit e1db982

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

.github/workflows/reusable-gatekeeper.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102
CLUSTER_JSON=$(aws eks list-clusters \
103103
--region "${{ inputs.aws-region }}" \
104104
--query "clusters" \
105-
--output json | jq -c '.')
105+
--output json | jq -c '[.[] | select(. | match("^tf-dev-"))]')
106106
echo "matrix=${CLUSTER_JSON}" >> $GITHUB_OUTPUT
107107
108108
enumerate-prod-clusters:
@@ -126,7 +126,7 @@ jobs:
126126
CLUSTER_JSON=$(aws eks list-clusters \
127127
--region "${{ inputs.aws-region }}" \
128128
--query "clusters" \
129-
--output json | jq -c '.')
129+
--output json | jq -c '[.[] | select(. | match("^tf-prod-"))]')
130130
echo "matrix=${CLUSTER_JSON}" >> $GITHUB_OUTPUT
131131
132132
gatekeeper-enforce-dev:

0 commit comments

Comments
 (0)