Skip to content

Commit 66e4843

Browse files
committed
ci: Add workflow to validate all kustomize builds
Signed-off-by: Francisco-Xiq <franciscopsf.contato@gmail.com>
1 parent dd35b5c commit 66e4843

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Validate Kustomize
3+
4+
on:
5+
pull_request:
6+
7+
jobs:
8+
validate-kustomize:
9+
runs-on: ubuntu-latest
10+
timeout-minutes: 5
11+
steps:
12+
- name: Checkout sources
13+
uses: actions/checkout@v4
14+
15+
- name: Install kustomize
16+
run: |
17+
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
18+
sudo mv kustomize /usr/local/bin/
19+
20+
- name: Validate all kustomization.yaml files
21+
run: |
22+
failed=0
23+
while IFS= read -r f; do
24+
dir=$(dirname "$f")
25+
echo "--- Validating $dir ---"
26+
if ! kustomize build "$dir" > /dev/null; then
27+
echo "::error file=$f::kustomize build failed for $dir"
28+
failed=1
29+
else
30+
echo "✓ $dir OK"
31+
fi
32+
done < <(find . -name "kustomization.yaml" -not -path "*/vendor/*")
33+
exit $failed

0 commit comments

Comments
 (0)