File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed
Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -84,29 +84,35 @@ jobs:
8484 major=$(echo "$last_tag" | cut -d. -f1)
8585 minor=$(echo "$last_tag" | cut -d. -f2)
8686 patch=$(echo "$last_tag" | cut -d. -f3)
87+ has_feat=false
8788 while IFS= read -r line; do
8889 subject=$(echo "$line" | cut -d' ' -f2-) # Extract the commit subject
8990 case "$subject" in
9091 *'feat:'*)
91- minor=$((minor + 1))
92- patch=0
92+ has_feat=true
9393 ;;
9494 *'fix:'*)
9595 patch=$((patch + 1))
9696 ;;
9797 *'BREAKING CHANGE:'*)
98- major=$((major + 1))
99- minor=0
100- patch=0
101- ;;
102- *)
103- patch=$((patch + 1))
98+ has_breaking_change=true
10499 ;;
105100 esac
106101 done < <(git log --pretty=format:"%h %s" "$commit_range")
102+ if [ "$has_breaking_change" = true ]; then
103+ major=$((major + 1))
104+ minor=0
105+ patch=0
106+ elif [ "$has_feat" = true ]; then
107+ minor=$((minor + 1))
108+ patch=0
109+ else
110+ patch=$((patch + 1))
111+ fi
107112 new_version="$major.$minor.$patch"
108113 echo "NEW VERSION SHOULD BE => $new_version"
109114 echo "::set-output name=new_version::$new_version"
115+
110116
111117 - name : Create new tag
112118 id : new_tag
You can’t perform that action at this time.
0 commit comments