多行 bash 字符串的续行未缩进到 run: | 块内,YAML 解析器 将 '- **版本**' 误判为列表项。改用 printf 单行拼接 BODY。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -40,13 +40,8 @@ jobs:
|
||||
COMMIT="${{ gitea.sha }}"
|
||||
COMMIT_MSG=$(git log -1 --pretty="%s" HEAD)
|
||||
RECENT_LOGS=$(git log -5 --pretty="- %s (%h)" HEAD)
|
||||
BODY="## 构建信息
|
||||
- **版本**: ${VERSION}
|
||||
- **Commit**: ${COMMIT}
|
||||
- **时间**: $(date '+%Y-%m-%d %H:%M:%S %Z')
|
||||
|
||||
## 最近提交
|
||||
${RECENT_LOGS}"
|
||||
BODY=$(printf '## 构建信息\n- **版本**: %s\n- **Commit**: %s\n- **时间**: %s\n\n## 最近提交\n%s' \
|
||||
"${VERSION}" "${COMMIT}" "$(date '+%Y-%m-%d %H:%M:%S %Z')" "${RECENT_LOGS}")
|
||||
|
||||
RESP=$(curl -s -X POST "${FORGEJO_URL}/api/v1/repos/${{ gitea.repository }}/releases" \
|
||||
-H "Authorization: token ${FORGEJO_TOKEN}" \
|
||||
|
||||
Reference in New Issue
Block a user