mirror of
https://github.com/dagger/dagger-for-github.git
synced 2025-12-30 20:29:49 +11:00
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:
parent
1b7f3b8d6b
commit
d809c269da
2 changed files with 21 additions and 0 deletions
18
.github/workflows/test.yml
vendored
18
.github/workflows/test.yml
vendored
|
|
@ -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: ./
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue