🔧 chore(stats): add emoji commit prefixes for generated updates
Ubuntu System Information / show-system-info (push) Successful in 1s Details

This commit is contained in:
csh 2026-05-22 16:48:56 +08:00
parent 550e226a2b
commit 778297543a
2 changed files with 12 additions and 2 deletions

View File

@ -380,7 +380,7 @@ jobs:
# 添加并提交 # 添加并提交
git add . git add .
git commit -m "chore: 初始化统计分支" git commit -m ":bar_chart: chore(stats): 初始化统计分支"
# 推送到远程 # 推送到远程
git push https://oauth2:${{ env.ACCESS_TOKEN }}@${GITHUB_SERVER_URL#https://}/${{ github.repository }}.git ${{ env.BADGE_BRANCH }} git push https://oauth2:${{ env.ACCESS_TOKEN }}@${GITHUB_SERVER_URL#https://}/${{ github.repository }}.git ${{ env.BADGE_BRANCH }}
@ -613,7 +613,7 @@ jobs:
echo "📝 准备提交..." echo "📝 准备提交..."
# 生成提交信息 # 生成提交信息
COMMIT_MSG="chore: 更新代码统计 [$(date '+%Y-%m-%d %H:%M')] COMMIT_MSG=":bar_chart: chore(stats): 更新代码统计 [$(date '+%Y-%m-%d %H:%M')]
📊 统计摘要: 📊 统计摘要:
- 总代码: ${{ steps.total.outputs.formatted_code }} 行 - 总代码: ${{ steps.total.outputs.formatted_code }} 行

View File

@ -220,6 +220,15 @@ test_stats_workflow_uses_svg_badges() {
! rg -q 'img\.shields\.io/endpoint|cpp-lines\.json' "${workflow_doc}" || fail "WORKFLOW.md should not document json endpoint badge usage" ! rg -q 'img\.shields\.io/endpoint|cpp-lines\.json' "${workflow_doc}" || fail "WORKFLOW.md should not document json endpoint badge usage"
} }
test_stats_workflow_uses_emoji_commit_messages() {
local file
file="${REPO_ROOT}/.gitea/workflows/update_stats_badge.yaml"
grep -q 'git commit -m ":bar_chart: chore(stats): 初始化统计分支"' "${file}" || fail "stats workflow should initialize stats branch with an emoji commit message"
grep -q 'COMMIT_MSG=":bar_chart: chore(stats): 更新代码统计 \[' "${file}" || fail "stats workflow should use an emoji commit prefix for future stats updates"
}
test_entrypoint_uses_platform_aware_multiarch_verification() { test_entrypoint_uses_platform_aware_multiarch_verification() {
local file local file
@ -248,6 +257,7 @@ test_setup_requires_upgrade_helper
test_entrypoint_uses_shared_buildx_builder_creation test_entrypoint_uses_shared_buildx_builder_creation
test_stats_workflow_avoids_eval_find test_stats_workflow_avoids_eval_find
test_stats_workflow_uses_svg_badges test_stats_workflow_uses_svg_badges
test_stats_workflow_uses_emoji_commit_messages
test_entrypoint_uses_platform_aware_multiarch_verification test_entrypoint_uses_platform_aware_multiarch_verification
echo "template_defaults_test.sh: PASS" echo "template_defaults_test.sh: PASS"