From f133b051dc2ea7a39e8b77632f485dcf5316b424 Mon Sep 17 00:00:00 2001 From: shaw Date: Sat, 27 Dec 2025 16:03:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DTG=E9=80=9A=E7=9F=A5wo?= =?UTF-8?q?rkflow=E8=AF=AD=E6=B3=95=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除if条件中对secrets的直接引用(GitHub Actions不支持) - 改用shell脚本内部检查环境变量是否存在 --- .github/workflows/release.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 40359ced..19b8d8de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -146,12 +146,17 @@ jobs: # Send Telegram notification - name: Send Telegram Notification - if: ${{ secrets.TELEGRAM_BOT_TOKEN != '' && secrets.TELEGRAM_CHAT_ID != '' }} env: TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} continue-on-error: true run: | + # 检查必要的环境变量 + if [ -z "$TELEGRAM_BOT_TOKEN" ] || [ -z "$TELEGRAM_CHAT_ID" ]; then + echo "Telegram credentials not configured, skipping notification" + exit 0 + fi + TAG_NAME=${GITHUB_REF#refs/tags/} VERSION=${TAG_NAME#v} REPO="${{ github.repository }}"