From a9d32975a9a7ed7e868af1dde6a64800b70f167e Mon Sep 17 00:00:00 2001 From: LIRUI <298977887@qq.com> Date: Mon, 28 Oct 2024 23:36:20 +0800 Subject: [PATCH] 1028.yml --- .github/workflows/翻译更新日志 copy.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/翻译更新日志 copy.yml b/.github/workflows/翻译更新日志 copy.yml index 4f73198..3ce5578 100644 --- a/.github/workflows/翻译更新日志 copy.yml +++ b/.github/workflows/翻译更新日志 copy.yml @@ -82,7 +82,14 @@ jobs: # 4. 创建中英文对照的更新日志,使用markdown格式的表格展示 - name: 生成中英文对照的更新日志 run: | + # 处理英文原文和中文翻译中的换行符为 `
` + ENGLISH_TEXT=$(echo "${{ steps.fetch_commits.outputs.messages }}" | sed ':a;N;$!ba;s/\n/
/g') + CHINESE_TEXT=$(echo "${{ steps.translate.outputs.translated_text }}" | sed ':a;N;$!ba;s/\n/
/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 \ No newline at end of file