diff --git a/.gitea/workflows/kubeconform.yml b/.gitea/workflows/kubeconform.yml index e48fb83..b578df4 100644 --- a/.gitea/workflows/kubeconform.yml +++ b/.gitea/workflows/kubeconform.yml @@ -3,6 +3,8 @@ name: Validate Kubernetes Manifests on: pull_request: branches: [main] + push: + branches: [main] jobs: kubeconform: @@ -51,27 +53,27 @@ jobs: # Create cache directory export KUBECONFORM_CACHE_DIR="/tmp/kubeconform-cache" mkdir -p "$KUBECONFORM_CACHE_DIR" - + # Exit code tracking EXIT_CODE=0 - + # Process all YAML files while IFS= read -r file; do echo "=== Validating: $file ===" - + # Skip excluded paths if [[ "$file" == *".gitea/"* ]] || [[ "$file" == *"clusters/default/system-upgrade/"* ]]; then echo "Skipping excluded file" continue fi - + # Detect resource kind KIND=$(yq -r '.kind // ""' "$file" 2>/dev/null || echo "") - + if [[ -n "$KIND" && -n "${SCHEMA_MAP[$KIND]}" ]]; then echo "Found $KIND - using custom schema" SCHEMA_URL="https://raw.githubusercontent.com/datreeio/CRDs-catalog/refs/heads/main/${SCHEMA_MAP[$KIND]}" - + if ! /kubeconform \ -schema-location "$SCHEMA_URL" \ -cache "$KUBECONFORM_CACHE_DIR" \ @@ -89,8 +91,8 @@ jobs: EXIT_CODE=1 fi fi - + echo "" done < <(find . -type f \( -name "*.yml" \) -print) - + exit $EXIT_CODE