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 }}"