Skip to content

Commit c24dbef

Browse files
authored
Refactor version extraction in publish.yml
Updated version extraction logic to use GITHUB_REF_NAME.
1 parent 7f4544d commit c24dbef

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ jobs:
2727

2828
- name: Pack with dotnet
2929
run: |
30-
arrTag=(${GITHUB_REF//\// })
31-
VERSION="${arrTag[2]}"
32-
VERSION="${VERSION#v}"
30+
# Strip leading 'v' if present
31+
VERSION="${GITHUB_REF_NAME#v}"
32+
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
3333
PACKAGE_PATH="${GITHUB_WORKSPACE}/artifacts"
3434
echo "$VERSION"
3535
dotnet pack --property:PackageOutputPath=$PACKAGE_PATH --configuration Release -p:Version=$VERSION -p:ContinuousIntegrationBuild=True

0 commit comments

Comments
 (0)