diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index f54e511..58e7d8b 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -70,7 +70,7 @@ jobs: - name: Determine next version id: version run: | - last_tag=$(git describe --abbrev=0) + last_tag=$(git describe --abbrev=0 --tags) commit_range="${last_tag}..HEAD" major=0 minor=0 @@ -106,6 +106,7 @@ jobs: git log --pretty=format:"%h %s" "$commit_range" > commits.txt - name: Create new tag + if: steps.commits.outputs.new_version != '0.0.0' run: git tag -a ${{ steps.version.outputs.new_version }} -m "Version ${{ steps.version.outputs.new_version }}" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -140,6 +141,7 @@ jobs: continue-on-error: false - name: Push new tag + if: steps.commits.outputs.new_version != '0.0.0' run: git push origin ${{ steps.version.outputs.new_version }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}