重写记录readme
Some checks failed
自动生成README.md文件 / create-readme (push) Failing after 10s

This commit is contained in:
liyp 2025-04-10 16:37:20 +08:00
parent 63aae4aa15
commit 2496fca391

View File

@ -35,24 +35,28 @@ jobs:
rm README.md
fi
- name: 添加项目标题到README.md文件
- name: 生成提交历史记录
id: commit-history
run: |
echo "# ActionDemo测试文档标题" > README.md
COMMIT_HISTORY=$(git log --pretty=format:"- %cd %h %an: %s" --date=short)
echo "::set-output name=commit_history::$COMMIT_HISTORY"
# - name : 获取提交记录到README.md文件
# run: |
# # 获取提交记录并追加到 README.md
# git log --pretty=format:"- %h %ad %s" --date=short >> README.md
- name: 获取版本发布记录到README.md文件
- name: 生成Release历史记录
id: release-history
run: |
echo "## 版本发布记录" >> README.md
# 获取标签信息并格式化输出
git tag -l --sort=-creatordate | while read tag; do
tag_date=$(git log -1 --format=%ad --date=short $tag)
tag_message=$(git tag -n9 $tag | sed 's/^[[:space:]]*//')
echo "- **$tag** ($tag_date): $tag_message" >> README.md
done
RELEASE_HISTORY=$(gh release list --limit 100 --json tagName,publishedAt,body --template '{{range .}}- {{.publishedAt}} {{.tagName}}: {{.body}}{{"\n"}}{{end}}')
echo "::set-output name=release_history::$RELEASE_HISTORY"
- name: 将提交和Release记录添加到README.md
run: |
{
echo
echo "# 提交历史记录"
echo "${{ steps.commit-history.outputs.commit_history }}"
echo
echo "# Release历史记录"
echo "${{ steps.release-history.outputs.release_history }}"
} >> README.md
- name: 重新提交仓库
env: