Files
homelab/.github/workflows/validate.yml
T
forust 6ecbbb39b4
validate / yaml (push) Successful in 7s
validate / k8s (push) Successful in 5s
Fix yamllint workflow invocation
2026-06-21 21:40:11 +02:00

53 lines
1.2 KiB
YAML

name: validate
on:
push:
branches:
- "**"
pull_request:
workflow_dispatch:
jobs:
yaml:
runs-on: [self-hosted, linux, arch, homelab]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Lint YAML syntax
shell: bash
run: |
docker run --rm \
-v "$PWD:/work" \
-w /work \
cytopia/yamllint:latest \
-c .yamllint .
k8s:
runs-on: [self-hosted, linux, arch, homelab]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Validate Kubernetes manifests
shell: bash
run: |
mapfile -t manifests < <(
git ls-files ':(glob)**/k8s/**/*.yaml' ':(glob)**/k8s/**/*.yml' \
| grep -Ev '(^|/)(kustomization\.ya?ml|.*\.example\.ya?ml|.*values\.ya?ml|patch-.*\.ya?ml)$'
)
if [ "${#manifests[@]}" -eq 0 ]; then
echo "No Kubernetes manifests found."
exit 0
fi
docker run --rm \
-v "$PWD:/work" \
-w /work \
ghcr.io/yannh/kubeconform:latest \
-strict \
-ignore-missing-schemas \
-summary \
"${manifests[@]}"