工作流文件有错
Some checks failed
AutoGenerateREADME.md / create-readme (push) Has been cancelled

This commit is contained in:
liyp 2025-04-10 15:47:02 +08:00
parent 7fed578bd3
commit 2cb29c46d2

View File

@ -38,27 +38,27 @@ jobs:
# 合并提交记录和版本标签信息,并按时间排序 # 合并提交记录和版本标签信息,并按时间排序
all_entries="$commits all_entries="$commits
$tags" $tags"
sorted_entries=$(echo "$all_entries" | sort -n) sorted_entries=$(echo "$all_entries" | sort -n)
# 遍历排序后的记录并写入 README # 遍历排序后的记录并写入 README
for entry in $sorted_entries; do for entry in $sorted_entries; do
timestamp=$(echo $entry | cut -d ' ' -f 1) timestamp=$(echo $entry | cut -d ' ' -f 1)
hash_or_tag=$(echo $entry | cut -d ' ' -f 2) hash_or_tag=$(echo $entry | cut -d ' ' -f 2)
rest=$(echo $entry | cut -d ' ' -f 3-) rest=$(echo $entry | cut -d ' ' -f 3-)
# 检查是否为版本标签 # 检查是否为版本标签
if [[ $hash_or_tag == refs/tags/* ]]; then if [[ $hash_or_tag == refs/tags/* ]]; then
tag_name=${hash_or_tag#refs/tags/} tag_name=${hash_or_tag#refs/tags/}
echo "## Version $tag_name" >> README.md echo "## Version $tag_name" >> README.md
else else
commit_hash=$hash_or_tag commit_hash=$hash_or_tag
author=$(echo $rest | cut -d ' ' -f 1) author=$(echo $rest | cut -d ' ' -f 1)
date=$(echo $rest | cut -d ' ' -f 2) date=$(echo $rest | cut -d ' ' -f 2)
message=$(echo $rest | cut -d ' ' -f 3-) message=$(echo $rest | cut -d ' ' -f 3-)
echo "- $commit_hash $author $date $message" >> README.md echo "- $commit_hash $author $date $message" >> README.md
fi fi
done done
- name: Commit and push changes - name: Commit and push changes
env: env: