Skip to content

Commit 2ea8a8c

Browse files
authored
fix: Replace bad substring usage with proper variable extraction (#323)
The substring function was being used incorrectly in the GitHub workflow, causing potential issues with version parsing. Replace with a proper shell parameter expansion approach using a dedicated step.
1 parent 66e86f3 commit 2ea8a8c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/on-release.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ on:
1919
env:
2020
GITHUB_REF: ${{ inputs.ref || github.event.ref }}
2121
GITHUB_RELEASE_TAG_NAME: ${{ inputs.release_tag || github.event.release.tag_name }}
22-
GITHUB_RELEASE_VERSION: ${{ startsWith(inputs.release_tag || github.event.release.tag_name, 'v') && substring(inputs.release_tag || github.event.release.tag_name, 1) || inputs.release_tag || github.event.release.tag_name }}
2322
GITHUB_RELEASE_URL: ${{ inputs.release_url || github.event.release.html_url }}
2423

2524
permissions:
@@ -37,6 +36,10 @@ jobs:
3736
with:
3837
ref: ${{ env.GITHUB_REF }}
3938

39+
- name: Strip v prefix from tag
40+
id: version
41+
run: echo "version=${GITHUB_RELEASE_TAG_NAME#v}" >> $GITHUB_OUTPUT
42+
4043
- name: Setup Docker
4144
uses: ./.github/actions/setup-docker
4245
with:
@@ -49,7 +52,7 @@ jobs:
4952
images: ${{ vars.DOCKER_IMAGE_UI }}
5053
tags: |
5154
type=semver,pattern={{version}}
52-
${{ env.GITHUB_RELEASE_VERSION }}
55+
${{ steps.version.outputs.version }}
5356
latest
5457
5558
- name: Docker Cloud Build and Push
@@ -59,7 +62,7 @@ jobs:
5962
build-args: TEMPORAL_CLOUD_UI=true
6063
tags: |
6164
type=semver,pattern={{version}}
62-
${{ env.GITHUB_RELEASE_TAG }}
65+
${{ steps.version.outputs.version }}
6366
latest
6467
6568
release-go:

0 commit comments

Comments
 (0)