Skip to content

Commit d809c26

Browse files
authored
Allow version without v (#194)
* add v to version if it does not have a leading v Signed-off-by: kpenfound <[email protected]> * test version without the v Signed-off-by: kpenfound <[email protected]> --------- Signed-off-by: kpenfound <[email protected]>
1 parent 1b7f3b8 commit d809c26

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.github/workflows/test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,24 @@ jobs:
161161
exit 1
162162
fi
163163
164+
- name: "Use 0.13.5 (no v)"
165+
id: use-0-13-5
166+
uses: ./
167+
with:
168+
version: 0.13.5
169+
verb: core
170+
args: version
171+
- name: "Use 0.13.5 (check)"
172+
run: |
173+
target='${{ steps.use-0-13-5.outputs.output }}'
174+
if [[ "$target" =~ v0\.13\.5 ]]; then
175+
echo "matches"
176+
exit 0
177+
else
178+
echo "does not match"
179+
exit 1
180+
fi
181+
164182
- name: "Use commit"
165183
id: use-commit
166184
uses: ./

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ runs:
8080
VERSION=${{ inputs.version }}
8181
if [[ "$VERSION" == "latest" ]]; then
8282
VERSION=
83+
elif [[ -n "$VERSION" && "$VERSION" != v* ]]; then
84+
# Add 'v' prefix if version doesn't start with 'v' and is not empty
85+
VERSION="v$VERSION"
8386
fi
8487
latest=$(curl https://dl.dagger.io/dagger/versions/latest)
8588

0 commit comments

Comments
 (0)