fix(action): explicitly resolve 'latest' version tag

The previous logic for detecting the 'latest' weld version relied on 'gh release download' interpreting an empty tag argument as the latest release. This was causing issues in consumer workflows, as it was seemingly looking for a literal 'latest' tag.

This commit updates the 'Get Version Tag for Download' step to explicitly query the GitHub API for the actual tag name of the latest release when 'weld-version' is set to 'latest'. This ensures a concrete tag is always provided to the download command, making the action more robust.
This commit is contained in:
2025-12-20 16:00:49 +03:00
parent 7b4cffd8c6
commit d78a286676

View File

@@ -25,10 +25,18 @@ runs:
- name: Get Version Tag for Download - name: Get Version Tag for Download
id: get_version id: get_version
shell: bash shell: bash
env:
GH_TOKEN: ${{ inputs.github-token }}
run: | run: |
VERSION_TAG="" VERSION_TAG=""
if [[ "${{ inputs.weld-version }}" != "latest" ]]; then if [[ "${{ inputs.weld-version }}" == "latest" ]]; then
echo "Figuring out the latest version..."
# Get the tag name of the latest release from the specified repo
VERSION_TAG=$(gh release view --repo ${{ inputs.repo }} --json tagName --jq .tagName)
echo "Latest version is ${VERSION_TAG}"
else
VERSION_TAG="${{ inputs.weld-version }}" VERSION_TAG="${{ inputs.weld-version }}"
echo "Using specified version ${VERSION_TAG}"
fi fi
echo "tag=${VERSION_TAG}" >> $GITHUB_OUTPUT echo "tag=${VERSION_TAG}" >> $GITHUB_OUTPUT