mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-22 16:43:35 +00:00
fix: 修复自动发布工作流的 YAML 语法错误
- 使用 heredoc 语法避免多行字符串中的转义问题 - 使用 jq 工具正确构建 JSON 数据 - 修复了第 170 行的 YAML 语法错误
This commit is contained in:
29
.github/workflows/auto-release.yml
vendored
29
.github/workflows/auto-release.yml
vendored
@@ -162,8 +162,9 @@ jobs:
|
||||
CHANGELOG_TRUNCATED="${CHANGELOG_TRUNCATED}..."
|
||||
fi
|
||||
|
||||
# 构建消息
|
||||
MESSAGE="🚀 *Claude Relay Service 新版本发布!*
|
||||
# 构建消息,使用 JSON 格式避免转义问题
|
||||
MESSAGE=$(cat <<-ENDMSG
|
||||
🚀 *Claude Relay Service 新版本发布!*
|
||||
|
||||
📦 版本号: \`${VERSION}\`
|
||||
|
||||
@@ -181,16 +182,22 @@ docker pull weishaw/claude-relay-service:latest
|
||||
• [完整更新日志](https://github.com/${REPO}/blob/main/CHANGELOG.md)
|
||||
• [Docker Hub](https://hub.docker.com/r/weishaw/claude-relay-service)
|
||||
|
||||
#ClaudeRelay #Update #v${VERSION//./_}"
|
||||
#ClaudeRelay #Update #v${VERSION//./_}
|
||||
ENDMSG
|
||||
)
|
||||
|
||||
# 准备 JSON 数据
|
||||
JSON_DATA=$(jq -n \
|
||||
--arg chat_id "${TELEGRAM_CHAT_ID}" \
|
||||
--arg text "${MESSAGE}" \
|
||||
'{
|
||||
chat_id: $chat_id,
|
||||
text: $text,
|
||||
parse_mode: "Markdown",
|
||||
disable_web_page_preview: false
|
||||
}')
|
||||
|
||||
# 发送消息到 Telegram
|
||||
curl -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d @- << EOF
|
||||
{
|
||||
"chat_id": "${TELEGRAM_CHAT_ID}",
|
||||
"text": "${MESSAGE}",
|
||||
"parse_mode": "Markdown",
|
||||
"disable_web_page_preview": false
|
||||
}
|
||||
EOF
|
||||
-d "${JSON_DATA}"
|
||||
Reference in New Issue
Block a user