From 2cb29c46d2d19bcb3f86074aab0c2887cc88d94f Mon Sep 17 00:00:00 2001 From: liyp Date: Thu, 10 Apr 2025 15:47:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=9C=89=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/AutoGenerateREADME.yaml | 38 ++++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.gitea/workflows/AutoGenerateREADME.yaml b/.gitea/workflows/AutoGenerateREADME.yaml index 3037f82..65bce31 100644 --- a/.gitea/workflows/AutoGenerateREADME.yaml +++ b/.gitea/workflows/AutoGenerateREADME.yaml @@ -38,27 +38,27 @@ jobs: # 合并提交记录和版本标签信息,并按时间排序 all_entries="$commits - $tags" - sorted_entries=$(echo "$all_entries" | sort -n) + $tags" + sorted_entries=$(echo "$all_entries" | sort -n) - # 遍历排序后的记录并写入 README - for entry in $sorted_entries; do - timestamp=$(echo $entry | cut -d ' ' -f 1) - hash_or_tag=$(echo $entry | cut -d ' ' -f 2) - rest=$(echo $entry | cut -d ' ' -f 3-) + # 遍历排序后的记录并写入 README + for entry in $sorted_entries; do + timestamp=$(echo $entry | cut -d ' ' -f 1) + hash_or_tag=$(echo $entry | cut -d ' ' -f 2) + rest=$(echo $entry | cut -d ' ' -f 3-) - # 检查是否为版本标签 - if [[ $hash_or_tag == refs/tags/* ]]; then - tag_name=${hash_or_tag#refs/tags/} - echo "## Version $tag_name" >> README.md - else - commit_hash=$hash_or_tag - author=$(echo $rest | cut -d ' ' -f 1) - date=$(echo $rest | cut -d ' ' -f 2) - message=$(echo $rest | cut -d ' ' -f 3-) - echo "- $commit_hash $author $date $message" >> README.md - fi - done + # 检查是否为版本标签 + if [[ $hash_or_tag == refs/tags/* ]]; then + tag_name=${hash_or_tag#refs/tags/} + echo "## Version $tag_name" >> README.md + else + commit_hash=$hash_or_tag + author=$(echo $rest | cut -d ' ' -f 1) + date=$(echo $rest | cut -d ' ' -f 2) + message=$(echo $rest | cut -d ' ' -f 3-) + echo "- $commit_hash $author $date $message" >> README.md + fi + done - name: Commit and push changes env: