Update .gitea/workflows/lint.yaml
Some checks failed
Check with kubeconform / lint (push) Failing after 6s
Some checks failed
Check with kubeconform / lint (push) Failing after 6s
This commit is contained in:
@ -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: |
|
||||
❌ <b>Kubernetes validation failed!</b>
|
||||
|
||||
<b>Invalid files:</b>
|
||||
📝 <b>Errors:</b>
|
||||
<pre>${{ join(files('invalid_files.txt'), '\n') }}</pre>
|
||||
|
||||
🔗 <a href="https://gt.hexor.cy/${{ github.repository }}/actions/runs/${{ github.run_number }}">Details</a>
|
||||
🔗 <a href="https://gt.hexor.cy/${{ github.repository }}/actions/runs/${{ github.run_number }}">Check details</a>
|
||||
|
Reference in New Issue
Block a user