name: Check with kubeconform on: push: branches: [main] jobs: lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: bmuschko/setup-kubeconform@v1 name: Setup Kubeconform - name: Validate manifests id: kubeconform run: | invalid_files=$( find . -name '*.yaml' ! -name '*values.yaml' ! -path './.gitea/*' -print0 | xargs -0 kubeconform \ -summary \ -output json \ -ignore-missing-schemas \ -schema-location default \ -schema-location 'https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/{{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json' \ -schema-location 'https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/kustomization.json' | jq -r '.resources[] | select(.status == "invalid") | "- \(.filename): \(.msg)"' ) if [[ -n "$invalid_files" ]]; then { echo 'FAILED=true' echo "INVALID_FILES<> "$GITHUB_ENV" echo "::error::Validation failed!" exit 1 else echo "✅ All manifests are valid!" fi continue-on-error: true - name: Notify Telegram on failure if: env.FAILED == 'true' uses: appleboy/telegram-action@master with: to: ${{ secrets.TELEGRAM_TO }} token: ${{ secrets.TELEGRAM_TOKEN }} format: html message: | ❌ Kubernetes validation failed! Invalid files:
${{ env.INVALID_FILES }}
🔗 Details