diff --git a/.github/workflows/tag-and-release.yml b/.github/workflows/tag-and-release.yml index 92cb7b7..ad1d143 100644 --- a/.github/workflows/tag-and-release.yml +++ b/.github/workflows/tag-and-release.yml @@ -29,9 +29,7 @@ jobs: env: DEFAULT_BUMP: minor GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} - run: | - echo "Token length: ${#GITHUB_TOKEN}" - ./bump_version.sh + run: ./bump_version.sh - name: Create Release if: success() diff --git a/bump_version.sh b/bump_version.sh index 6eccf7b..c69df2c 100755 --- a/bump_version.sh +++ b/bump_version.sh @@ -1,12 +1,18 @@ #!/bin/bash set -e +# Fetch all tags +git fetch --tags + # Default bump type DEFAULT_BUMP=${DEFAULT_BUMP:-minor} # Get the current version CURRENT_VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0") +# Remove the 'v' prefix if it exists +CURRENT_VERSION=${CURRENT_VERSION#v} + # Split the version into parts IFS='.' read -r -a VERSION_PARTS <<< "$CURRENT_VERSION" MAJOR="${VERSION_PARTS[0]}"