diff --git a/.gitea/workflows/lint.yaml b/.gitea/workflows/lint.yaml index 68e2165..d0ed566 100644 --- a/.gitea/workflows/lint.yaml +++ b/.gitea/workflows/lint.yaml @@ -39,18 +39,27 @@ jobs: echo "$VALIDATION_OUTPUT" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV + # Display the output in the logs + cat $VALIDATION_OUTPUT_FILE + # Check if there were validation errors if grep -q "Error" $VALIDATION_OUTPUT_FILE; then echo "VALIDATION_FAILED=true" >> $GITHUB_ENV echo "::error::Kubernetes manifest validation failed!" - echo "$VALIDATION_OUTPUT" exit 1 else echo "All manifests are valid!" - echo "$VALIDATION_OUTPUT" fi continue-on-error: true + - name: Extract invalid files + if: env.VALIDATION_FAILED == 'true' + id: extract_errors + run: | + echo "INVALID_FILES<> $GITHUB_ENV + grep -o "[^ ]*.yaml:.*Error:" <<< "${{ env.VALIDATION_OUTPUT }}" | sort | uniq >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + - name: Telegram notify on validation failure if: env.VALIDATION_FAILED == 'true' uses: appleboy/telegram-action@master @@ -61,12 +70,7 @@ jobs: 🚨 Kubernetes manifest validation failed! Repository: ${{ github.repository }} - Branch: ${{ github.ref_name }} - Commit: ${{ github.sha }} + Files with errors: + ${{ env.INVALID_FILES }} - Validation errors: - ``` - ${{ env.VALIDATION_OUTPUT }} - ``` - - See full details: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} \ No newline at end of file + Check action: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} \ No newline at end of file