Skip to content

Commit

Permalink
cd: fix the step of generate release version
Browse files Browse the repository at this point in the history
  • Loading branch information
brunograna committed Feb 18, 2024
1 parent 8edc60d commit 34d34f0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ jobs:
minor=0
patch=0
while IFS= read -r line; do
case "$line" in
subject=$(echo "$line" | cut -d' ' -f2-) # Extract the commit subject
case "$subject" in
*'feat:'*)
minor=$((minor + 1))
;;
Expand All @@ -87,7 +88,7 @@ jobs:
major=$((major + 1))
;;
esac
done < <(git log --pretty=format:"%s" "$commit_range")
done < <(git log --pretty=format:"%h %s" "$commit_range")
if [ $major -gt 0 ]; then
new_version="$((major + 1)).0.0"
elif [ $minor -gt 0 ]; then
Expand All @@ -101,7 +102,8 @@ jobs:
- name: Get previous tag
id: previous_tag
run: |
previous_tag=$(git describe --abbrev=0 --tags ${{ steps.version.outputs.new_version }}^)
git fetch --tags
previous_tag=$(git describe --abbrev=0 --tags $(git rev-list --tags --max-count=1))
echo "::set-output name=previous_tag::$previous_tag"
- name: Create new tag
Expand Down

0 comments on commit 34d34f0

Please sign in to comment.