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 "$VALIDATION_OUTPUT" >> $GITHUB_ENV
|
||||||
echo "EOF" >> $GITHUB_ENV
|
echo "EOF" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
# Display the output in the logs
|
||||||
|
cat $VALIDATION_OUTPUT_FILE
|
||||||
|
|
||||||
# Check if there were validation errors
|
# Check if there were validation errors
|
||||||
if grep -q "Error" $VALIDATION_OUTPUT_FILE; then
|
if grep -q "Error" $VALIDATION_OUTPUT_FILE; then
|
||||||
echo "VALIDATION_FAILED=true" >> $GITHUB_ENV
|
echo "VALIDATION_FAILED=true" >> $GITHUB_ENV
|
||||||
echo "::error::Kubernetes manifest validation failed!"
|
echo "::error::Kubernetes manifest validation failed!"
|
||||||
echo "$VALIDATION_OUTPUT"
|
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo "All manifests are valid!"
|
echo "All manifests are valid!"
|
||||||
echo "$VALIDATION_OUTPUT"
|
|
||||||
fi
|
fi
|
||||||
continue-on-error: true
|
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
|
- name: Telegram notify on validation failure
|
||||||
if: env.VALIDATION_FAILED == 'true'
|
if: env.VALIDATION_FAILED == 'true'
|
||||||
uses: appleboy/telegram-action@master
|
uses: appleboy/telegram-action@master
|
||||||
@ -61,12 +70,7 @@ jobs:
|
|||||||
🚨 Kubernetes manifest validation failed!
|
🚨 Kubernetes manifest validation failed!
|
||||||
|
|
||||||
Repository: ${{ github.repository }}
|
Repository: ${{ github.repository }}
|
||||||
Branch: ${{ github.ref_name }}
|
Files with errors:
|
||||||
Commit: ${{ github.sha }}
|
${{ env.INVALID_FILES }}
|
||||||
|
|
||||||
Validation errors:
|
Check action: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||||
```
|
|
||||||
${{ env.VALIDATION_OUTPUT }}
|
|
||||||
```
|
|
||||||
|
|
||||||
See full details: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
|
Reference in New Issue
Block a user