feat: Enhance update-charts workflow with error handling and notifications

This commit is contained in:
sha
2026-03-22 12:32:09 +02:00
parent f6c0489942
commit 4dbc65729d
3 changed files with 53 additions and 11 deletions
+30 -1
View File
@@ -32,6 +32,11 @@ jobs:
else
echo "updates=false" >> $GITHUB_OUTPUT
fi
if [ -f errors_summary.txt ]; then
echo "errors=true" >> $GITHUB_OUTPUT
else
echo "errors=false" >> $GITHUB_OUTPUT
fi
- name: Commit and Push Changes
if: steps.git-check.outputs.updates == 'true'
@@ -43,7 +48,7 @@ jobs:
git pull --rebase origin main
git push
- name: Send Signal Notification
- name: Send Signal Notification (Updates)
if: steps.git-check.outputs.updates == 'true'
env:
SIGNAL_URL: ${{ secrets.SIGNAL_URL }}
@@ -66,3 +71,27 @@ jobs:
curl -X POST "$SIGNAL_URL" \
-H "Content-Type: application/json" \
-d "$PAYLOAD"
- name: Send Signal Notification (Errors)
if: steps.git-check.outputs.errors == 'true'
env:
SIGNAL_URL: ${{ secrets.SIGNAL_URL }}
SIGNAL_SENDER: ${{ secrets.SIGNAL_SENDER }}
SIGNAL_RECIPIENT: ${{ secrets.SIGNAL_RECIPIENT }}
run: |
if [ -z "$SIGNAL_URL" ] || [ -z "$SIGNAL_SENDER" ] || [ -z "$SIGNAL_RECIPIENT" ]; then
echo "Signal secrets not fully configured, skipping notification."
exit 0
fi
ERRORS=$(cat errors_summary.txt)
MESSAGE=$(printf '⚠️ Helm Charts Version Check Errors\n\n%s' "$ERRORS")
PAYLOAD=$(jq -n \
--arg msg "$MESSAGE" \
--arg num "$SIGNAL_SENDER" \
--arg rec "$SIGNAL_RECIPIENT" \
'{message: $msg, number: $num, recipients: [$rec]}')
curl -X POST "$SIGNAL_URL" \
-H "Content-Type: application/json" \
-d "$PAYLOAD"