Update .gitea/workflows/lint.yaml
Some checks failed
Check with kubeconform / lint (push) Failing after 7s
Some checks failed
Check with kubeconform / lint (push) Failing after 7s
This commit is contained in:
@ -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<<EOF" >> $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 }}
|
||||
Check action: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
Reference in New Issue
Block a user