diff --git a/.github/workflows/release-go-module.yml b/.github/workflows/release-go-module.yml index 69f237736..d5218dd1c 100644 --- a/.github/workflows/release-go-module.yml +++ b/.github/workflows/release-go-module.yml @@ -30,8 +30,8 @@ jobs: id: extract_package_name run: | TAG_REF="${GITHUB_REF#refs/tags/}" - PACKAGE_NAME=$(echo "$TAG_REF" | cut -d'/' -f1) - VERSION=$(echo "$TAG_REF" | cut -d'/' -f2) + PACKAGE_NAME="${TAG_REF%/*}" + VERSION="${TAG_REF##*/}" echo "Tag Reference: $TAG_REF" echo "Package Name: $PACKAGE_NAME" echo "Version: $VERSION" @@ -41,11 +41,6 @@ jobs: - name: Find Last Tag for Package and Generate Release Notes id: generate_release_notes run: | - # Extract the package name and version from the tag - TAG_REF="${GITHUB_REF#refs/tags/}" - PACKAGE_NAME="${TAG_REF%/*}" - VERSION="${TAG_REF##*/}" - # Find the latest tag for the same package that is not the current tag LAST_TAG=$(git describe --abbrev=0 --always --match "$PACKAGE_NAME/v*" --tags $(git rev-list --tags --skip=1 --max-count=1)) echo "Last tag: ${LAST_TAG}"