Skip to content

Commit acb54dd

Browse files
committed
fix: update version retrieval logic to use environment variables
1 parent 8517ef7 commit acb54dd

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

.github/workflows/update_version.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ jobs:
3030
- name: Get version
3131
id: get_version
3232
run: |
33-
if [ -n "${{ inputs.version }}" ]; then
34-
VERSION="${{ inputs.version }}"
35-
elif [ "${{ github.event_name }}" = "release" ]; then
36-
VERSION="${{ github.event.release.tag_name }}"
33+
if [ -n "${INPUT_VERSION}" ]; then
34+
VERSION="${INPUT_VERSION}"
35+
elif [ "${EVENT_NAME}" = "release" ]; then
36+
VERSION="${RELEASE_TAG}"
3737
else
3838
VERSION=$(git describe --tags --abbrev=0)
3939
fi
@@ -45,6 +45,9 @@ jobs:
4545
echo "version=${VERSION}" >> $GITHUB_OUTPUT
4646
env:
4747
GH_TOKEN: ${{ github.token }}
48+
INPUT_VERSION: ${{ inputs.version }}
49+
EVENT_NAME: ${{ github.event_name }}
50+
RELEASE_TAG: ${{ github.event.release.tag_name }}
4851

4952
- name: Write version to version.txt
5053
run: echo "${{ env.VERSION }}" > version.txt

0 commit comments

Comments
 (0)