Skip to content

Commit 34d34f0

Browse files
committed
cd: fix the step of generate release version
1 parent 8edc60d commit 34d34f0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/cd.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ jobs:
7676
minor=0
7777
patch=0
7878
while IFS= read -r line; do
79-
case "$line" in
79+
subject=$(echo "$line" | cut -d' ' -f2-) # Extract the commit subject
80+
case "$subject" in
8081
*'feat:'*)
8182
minor=$((minor + 1))
8283
;;
@@ -87,7 +88,7 @@ jobs:
8788
major=$((major + 1))
8889
;;
8990
esac
90-
done < <(git log --pretty=format:"%s" "$commit_range")
91+
done < <(git log --pretty=format:"%h %s" "$commit_range")
9192
if [ $major -gt 0 ]; then
9293
new_version="$((major + 1)).0.0"
9394
elif [ $minor -gt 0 ]; then
@@ -101,7 +102,8 @@ jobs:
101102
- name: Get previous tag
102103
id: previous_tag
103104
run: |
104-
previous_tag=$(git describe --abbrev=0 --tags ${{ steps.version.outputs.new_version }}^)
105+
git fetch --tags
106+
previous_tag=$(git describe --abbrev=0 --tags $(git rev-list --tags --max-count=1))
105107
echo "::set-output name=previous_tag::$previous_tag"
106108
107109
- name: Create new tag

0 commit comments

Comments
 (0)