Release v1.4.5 测试生成readme.md
Some checks failed
自动版本发布 / AutoRelease (push) Successful in 15s
自动版本发布 / AutoREADME.md (push) Failing after 8s

This commit is contained in:
liyp 2025-04-12 17:08:09 +08:00
parent a546ab0d63
commit 336b7dd8e0

View File

@ -206,6 +206,34 @@ jobs:
echo "$REPO_NAME" > README.md
fi
- name: 获取版本发布时间线
id: timeline
run: |
# 获取提交记录
COMMITS=$(git log --pretty=format:"- %ad - Commit: %s (%h)" --date=iso-strict)
# 获取版本发布记录
RELEASES=$(curl -s "https://<your-gitea-instance>/api/v1/repos/${{ github.repository }}/releases" | jq -r '.[] | "- \(.published_at) - Release: \(.name) (\(.tag_name))"')
# 合并并按时间排序
COMBINED_TIMELINE=$(echo -e "$COMMITS\n$RELEASES" | sort -r)
echo "::set-output name=timeline::$COMBINED_TIMELINE"
- name: 将提交记录和release记录输出到readme
run: |
if [ -f "README.md" ]; then
TEMP=$(cat README.md)
{
echo "### Repository Timeline"
echo "${{ steps.timeline.outputs.timeline }}"
echo ""
echo "$TEMP"
} > README.md
else
{
echo "### Repository Timeline"
echo "${{ steps.timeline.outputs.timeline }}"
} > README.md
fi
- name: 提交和推送代码
run: |
git add README.md