diff --git a/.gitea/workflows/lint.yaml b/.gitea/workflows/lint.yaml index 9992539..38e9bde 100644 --- a/.gitea/workflows/lint.yaml +++ b/.gitea/workflows/lint.yaml @@ -14,12 +14,14 @@ jobs: name: Setup Kubeconform - name: Validate manifests + id: validation run: | find . -name '*.yaml' \ ! -name '*values.yaml' \ - ! -path './.gitea/*' -print0 | - xargs -0 kubeconform \ + ! -path './.gitea/*' -print0 \ + | xargs -0 kubeconform \ -summary \ + -verbose \ -output json \ -ignore-missing-schemas \ -schema-location default \ @@ -30,15 +32,16 @@ jobs: invalid_count=$(jq '[.resources[] | select(.status=="invalid")] | length' kubeconform_output.json) if [[ "$invalid_count" -gt 0 ]]; then - jq -r '.resources[] | select(.status=="invalid") | "- \(.filename): \(.msg)"' kubeconform_output.json > invalid_files.txt - cat invalid_files.txt + echo "❌ Found $invalid_count invalid manifests:" + jq -r '.resources[] | select(.status=="invalid") | "- \(.filename): \(.msg)"' kubeconform_output.json \ + | tee invalid_files.txt echo "::error::Validation failed with $invalid_count errors." exit 1 else - echo "✅ All manifests valid!" + echo "✅ All manifests are valid!" fi - - name: Notify Telegram on failure + - name: Send Telegram notification on failure if: failure() uses: appleboy/telegram-action@master with: @@ -48,7 +51,7 @@ jobs: message: | ❌ Kubernetes validation failed! - Invalid files: + 📝 Errors:
${{ join(files('invalid_files.txt'), '\n') }}
- 🔗 Details + 🔗 Check details