Allow version without v (#194)

* add v to version if it does not have a leading v

Signed-off-by: kpenfound <kyle@dagger.io>

* test version without the v

Signed-off-by: kpenfound <kyle@dagger.io>

---------

Signed-off-by: kpenfound <kyle@dagger.io>
This commit is contained in:
Kyle Penfound 2025-10-01 11:01:20 -04:00 committed by GitHub
parent 1b7f3b8d6b
commit d809c269da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 0 deletions

View file

@ -161,6 +161,24 @@ jobs:
exit 1
fi
- name: "Use 0.13.5 (no v)"
id: use-0-13-5
uses: ./
with:
version: 0.13.5
verb: core
args: version
- name: "Use 0.13.5 (check)"
run: |
target='${{ steps.use-0-13-5.outputs.output }}'
if [[ "$target" =~ v0\.13\.5 ]]; then
echo "matches"
exit 0
else
echo "does not match"
exit 1
fi
- name: "Use commit"
id: use-commit
uses: ./

View file

@ -80,6 +80,9 @@ runs:
VERSION=${{ inputs.version }}
if [[ "$VERSION" == "latest" ]]; then
VERSION=
elif [[ -n "$VERSION" && "$VERSION" != v* ]]; then
# Add 'v' prefix if version doesn't start with 'v' and is not empty
VERSION="v$VERSION"
fi
latest=$(curl https://dl.dagger.io/dagger/versions/latest)