Skip to content

Commit 43f3d52

Browse files
authored
fix: Normalize current version by removing 'v' prefix if present (#5500)
1 parent af3056b commit 43f3d52

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

.github/workflows/publish_web_ui.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
type: string
1010
token:
1111
description: 'Personal Access Token'
12-
required: true
12+
required: false
1313
default: ""
1414
type: string
1515
publish_ui:
@@ -25,7 +25,7 @@ on:
2525
type: string
2626
token:
2727
description: 'Personal Access Token'
28-
required: true
28+
required: false
2929
default: ""
3030
type: string
3131
publish_ui:
@@ -43,20 +43,32 @@ jobs:
4343
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4444
steps:
4545
- uses: actions/checkout@v4
46-
- id: get-version
46+
- id: get-current-version
47+
if: github.event.inputs.custom_version != ''
4748
uses: ./.github/actions/get-semantic-release-version
4849
with:
49-
custom_version: ${{ github.event.inputs.custom_version }}
5050
token: ${{ github.event.inputs.token || github.token }}
5151
- name: Setup Node.js
5252
uses: actions/setup-node@v3
5353
with:
5454
node-version-file: './ui/.nvmrc'
5555
- name: Bump file versions (temporarily for Web UI publish)
56+
if: github.event.inputs.custom_version != ''
5657
env:
57-
CURRENT_VERSION: ${{ steps.get-version.outputs.highest_semver_tag }}
58-
NEXT_VERSION: ${{ steps.get-version.outputs.version_without_prefix }}
59-
run: python ./infra/scripts/release/bump_file_versions.py ${CURRENT_VERSION} ${NEXT_VERSION}
58+
CUSTOM_VERSION: ${{ github.event.inputs.custom_version }}
59+
run: |
60+
# Get current version from action output (already normalized without 'v' prefix)
61+
CURRENT_VERSION="${{ steps.get-current-version.outputs.version_without_prefix }}"
62+
63+
# Normalize custom version (next version) by removing 'v' prefix if present
64+
NEXT_VERSION="${CUSTOM_VERSION}"
65+
if [[ "$NEXT_VERSION" =~ ^v ]]; then
66+
NEXT_VERSION="${NEXT_VERSION:1}"
67+
fi
68+
69+
echo "Using current version from action: $CURRENT_VERSION"
70+
echo "Using next version (custom): $NEXT_VERSION"
71+
python ./infra/scripts/release/bump_file_versions.py ${CURRENT_VERSION} ${NEXT_VERSION}
6072
- name: Install yarn dependencies
6173
working-directory: ./ui
6274
run: yarn install

0 commit comments

Comments
 (0)