chore: Secure Signal notifications with secrets check

This commit is contained in:
sha
2026-03-16 01:33:22 +02:00
parent 479f9ad93d
commit 46ddaa5f4b
2 changed files with 66 additions and 1 deletions
+61
View File
@@ -0,0 +1,61 @@
name: Update Charts
on:
schedule:
- cron: '0 3 * * *' # Every day at 3 AM
workflow_dispatch: # Manual trigger
jobs:
update-charts:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Environment
run: |
sudo apt-get update
sudo apt-get install -y jq
- name: Run Update Script
run: |
chmod +x scripts/update-charts.sh
./scripts/update-charts.sh
- name: Check for Changes
id: git-check
run: |
if [ -f update_summary.txt ]; then
echo "updates=true" >> $GITHUB_OUTPUT
else
echo "updates=false" >> $GITHUB_OUTPUT
fi
- name: Commit and Push Changes
if: steps.git-check.outputs.updates == 'true'
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "chore: Automated version update for Helm charts"
git push
- name: Send Signal Notification
if: |
steps.git-check.outputs.updates == 'true' &&
secrets.SIGNAL_URL != '' &&
secrets.SIGNAL_SENDER != '' &&
secrets.SIGNAL_RECIPIENT != ''
run: |
SUMMARY=$(cat update_summary.txt)
MESSAGE="🚀 **Helm Charts Updated**\n\n$SUMMARY\n\nView changes: https://github.com/shadoll/helm-charts/commits/main"
curl -X POST "${{ secrets.SIGNAL_URL }}" \
-H "Content-Type: application/json" \
-d "{
\"message\": \"$MESSAGE\",
\"number\": \"${{ secrets.SIGNAL_SENDER }}\",
\"recipients\": [\"${{ secrets.SIGNAL_RECIPIENT }}\"]
}"