From 1ef8cecc3961dd1c76f4f9dffccfda8d50e92c29 Mon Sep 17 00:00:00 2001 From: Liuyf Date: Tue, 18 Feb 2025 10:29:23 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E5=B0=8F=E7=89=88=E6=9C=AC=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E8=A7=84=E5=88=99=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tag_generator.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tag_generator.sh b/tag_generator.sh index 39c384ee..27e39182 100755 --- a/tag_generator.sh +++ b/tag_generator.sh @@ -27,22 +27,23 @@ else fi echo "compare_json:$compare_json\n" new_patch=$patch + new_minor=$minor while IFS= read -r commit_json; do # 使用 jq 解析每一行的 JSON 对象 commit_id=$(echo "$commit_json" | jq -r '.id') commit_message=$(echo "$commit_json" | jq -r '.message') echo "----$commit_message" - if [[ "$commit_message" =~ ("feat:"*) ]]; then - ((minor++)) + if [[ "$commit_message" =~ ("feat:"*) ]] && [[ $new_minor == $minor ]]; then + ((new_minor++)) # new_patch=0 - break - elif [[ "$commit_message" =~ ("fix:"*) ]] && [[ $new_patch == $patch ]]; then +# break + elif [[ "$commit_message" =~ ("fix:"*) ]]; then ((new_patch++)) - elif [[ ! "$commit_message" =~ ("Merge"* | "Revert"*) ]] && [[ $new_patch == $patch ]]; then + elif [[ ! "$commit_message" =~ ("Merge"* | "Revert"*) ]]; then ((new_patch++)) fi done < <(echo "$compare_json" | jq -c '.commits[] | {id: .id, message: .message}') - next_tag="v$major.$minor.$new_patch" + next_tag="v$major.$new_minor.$new_patch" fi echo "New Tag:$newest_tag;New version: $next_tag;command: $1" if [[ "$1" == "generate_tag" ]];then