From 2ca78ac8e9ed100b255385ea0936f63953e5a4e0 Mon Sep 17 00:00:00 2001 From: Alter-xyz <88554920+alterxyz@users.noreply.github.com> Date: Sun, 18 May 2025 00:20:13 +0800 Subject: [PATCH] fix: git message --- .github/workflows/docs_bundle.yml | 23 +++++++++++++++-------- plugin_dev_zh/test.mdx | 25 +------------------------ tools/main_docs_bundle.py | 2 +- 3 files changed, 17 insertions(+), 33 deletions(-) diff --git a/.github/workflows/docs_bundle.yml b/.github/workflows/docs_bundle.yml index 95cdf028..784ba234 100644 --- a/.github/workflows/docs_bundle.yml +++ b/.github/workflows/docs_bundle.yml @@ -52,22 +52,29 @@ jobs: run: | # Check if there are file changes if [[ -n "$(git status --porcelain)" ]]; then - FIXED_COMMIT_SUBJECT="Docs: Automated documentation updates" - - COMMIT_DESCRIPTION="" + FINAL_COMMIT_SUBJECT="" if [[ -n "${{ steps.doc-tools.outputs.commit_message }}" ]]; then - COMMIT_DESCRIPTION="${{ steps.doc-tools.outputs.commit_message }}" + FINAL_COMMIT_SUBJECT="${{ steps.doc-tools.outputs.commit_message }}" else - COMMIT_DESCRIPTION="Automated processing of documentation files." + FINAL_COMMIT_SUBJECT="Docs: Automated documentation updates" # Default subject if script provides none + fi + + FINAL_COMMIT_BODY="" + if [[ -n "${{ steps.doc-tools.outputs.detailed_message }}" ]]; then + FINAL_COMMIT_BODY="${{ steps.doc-tools.outputs.detailed_message }}" + else + FINAL_COMMIT_BODY="No detailed information provided by the script." # Default body if script provides none fi git config --local user.email "88554920+alterxyz@users.noreply.github.com" git config --local user.name "alterxyz" git add . - git commit -m "$FIXED_COMMIT_SUBJECT" -m "$COMMIT_DESCRIPTION" || echo "No changes to commit" + # Use the subject from script's commit_message and body from script's detailed_message + git commit -m "$FINAL_COMMIT_SUBJECT" -m "$FINAL_COMMIT_BODY" || echo "No changes to commit" git push - echo "Changes committed with subject: $FIXED_COMMIT_SUBJECT" - echo "Description: $COMMIT_DESCRIPTION" + echo "Changes committed with subject: $FINAL_COMMIT_SUBJECT" + echo "Description:" + echo "$FINAL_COMMIT_BODY" else echo "No file changes, skipping commit" fi diff --git a/plugin_dev_zh/test.mdx b/plugin_dev_zh/test.mdx index 6052a212..48802626 100644 --- a/plugin_dev_zh/test.mdx +++ b/plugin_dev_zh/test.mdx @@ -1,26 +1,3 @@ # 测试 -hello, 这是一个测试. 我们随后更新 frontmatter. - -{/* -Contributing Section -DO NOT edit this section! -It will be automatically generated by the script. -*/} - - - - 通过直接提交修改来帮助改进文档内容 - - - 发现错误或有改进建议?请提交问题反馈 - - +hello, 这是一个测试. 我们随后更新 frontmatter, \ No newline at end of file diff --git a/tools/main_docs_bundle.py b/tools/main_docs_bundle.py index 862beba5..6faf3148 100644 --- a/tools/main_docs_bundle.py +++ b/tools/main_docs_bundle.py @@ -20,7 +20,7 @@ def set_github_output(name, value): print(f"[GitHub Output] {name}={value}") def main(): - total_message = "Details:\n" + total_message = " \n" success_count = 0 error_count = 0