1028.yml
All checks were successful
翻译更新日志 / generate_changelog (push) Successful in 24s

This commit is contained in:
298977887 2024-10-28 23:36:20 +08:00
parent 42f94c0b9a
commit a9d32975a9

View File

@ -82,7 +82,14 @@ jobs:
# 4. 创建中英文对照的更新日志使用markdown格式的表格展示
- name: 生成中英文对照的更新日志
run: |
# 处理英文原文和中文翻译中的换行符为 `<br>`
ENGLISH_TEXT=$(echo "${{ steps.fetch_commits.outputs.messages }}" | sed ':a;N;$!ba;s/\n/<br>/g')
CHINESE_TEXT=$(echo "${{ steps.translate.outputs.translated_text }}" | sed ':a;N;$!ba;s/\n/<br>/g')
# 创建 Markdown 表格
echo "| 英文原文 | 中文翻译 |" > ./更新日志对照表格.md
echo "| --- | --- |" >> ./更新日志对照表格.md
echo "| ${{ steps.fetch_commits.outputs.messages }} | ${{ steps.translate.outputs.translated_text }} |" >> ./更新日志对照表格.md
cat ./更新日志对照表格.md
echo "| $ENGLISH_TEXT | $CHINESE_TEXT |" >> ./更新日志对照表格.md
# 输出表格内容,方便调试
cat ./更新日志对照表格.md