mirror of
https://github.com/CCLeonOS/LeonOS.git
synced 2026-03-03 06:47:00 +00:00
ci(workflow): 改进初始提交检测逻辑
使用正则表达式更准确地检测初始提交,避免误判40字符SHA值为"initial-commit"
This commit is contained in:
3
.github/workflows/release-auto-commit.yml
vendored
3
.github/workflows/release-auto-commit.yml
vendored
@@ -25,7 +25,8 @@ jobs:
|
||||
- name: Generate commit log
|
||||
id: commit_log
|
||||
run: |
|
||||
if [ "${{ steps.prev_tag.outputs.prev_tag }}" = "initial-commit" ]; then
|
||||
# 检查是否是初始commit(SHA值通常是40个字符的十六进制数)
|
||||
if [[ "${{ steps.prev_tag.outputs.prev_tag }}" =~ ^[0-9a-fA-F]{40}$ ]]; then
|
||||
COMMIT_LOG=$(git log --pretty=format:"- [%h] %s" --reverse)
|
||||
else
|
||||
COMMIT_LOG=$(git log ${{ steps.prev_tag.outputs.prev_tag }}..HEAD --pretty=format:"- [%h] %s" --reverse)
|
||||
|
||||
Reference in New Issue
Block a user