Skip to content

Commit d6c51cb

Browse files
authored
do not extract version & package 2x (#1249)
1 parent 0b98e39 commit d6c51cb

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

.github/workflows/release-go-module.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ jobs:
3030
id: extract_package_name
3131
run: |
3232
TAG_REF="${GITHUB_REF#refs/tags/}"
33-
PACKAGE_NAME=$(echo "$TAG_REF" | cut -d'/' -f1)
34-
VERSION=$(echo "$TAG_REF" | cut -d'/' -f2)
33+
PACKAGE_NAME="${TAG_REF%/*}"
34+
VERSION="${TAG_REF##*/}"
3535
echo "Tag Reference: $TAG_REF"
3636
echo "Package Name: $PACKAGE_NAME"
3737
echo "Version: $VERSION"
@@ -41,11 +41,6 @@ jobs:
4141
- name: Find Last Tag for Package and Generate Release Notes
4242
id: generate_release_notes
4343
run: |
44-
# Extract the package name and version from the tag
45-
TAG_REF="${GITHUB_REF#refs/tags/}"
46-
PACKAGE_NAME="${TAG_REF%/*}"
47-
VERSION="${TAG_REF##*/}"
48-
4944
# Find the latest tag for the same package that is not the current tag
5045
LAST_TAG=$(git describe --abbrev=0 --always --match "$PACKAGE_NAME/v*" --tags $(git rev-list --tags --skip=1 --max-count=1))
5146
echo "Last tag: ${LAST_TAG}"

0 commit comments

Comments
 (0)