Skip to content

Commit 169ea4a

Browse files
committed
ci: format Telegram deployment notification
1 parent d809489 commit 169ea4a

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

‎.github/workflows/deploy.yml‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,19 @@ jobs:
5151
id: deployment
5252
uses: actions/deploy-pages@v4
5353
- name: Notify Telegram on successful deployment
54+
if: success()
5455
env:
5556
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
5657
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
5758
PAGE_URL: ${{ steps.deployment.outputs.page_url }}
5859
run: |
60+
message="$(cat <<EOF
61+
✅ Scripting 文档已部署成功
62+
${PAGE_URL}
63+
提交:${GITHUB_SHA::7}
64+
EOF
65+
)"
5966
curl --fail --silent --show-error \
6067
--request POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
6168
--data-urlencode "chat_id=${TELEGRAM_CHAT_ID}" \
62-
--data-urlencode "text=✅ Scripting 文档已部署成功
63-
${PAGE_URL}
64-
提交:${GITHUB_SHA::7}"
69+
--data-urlencode "text=${message}"

0 commit comments

Comments
 (0)