diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 368f642..699709b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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: ./ diff --git a/action.yml b/action.yml index 2e9335f..e8b25f6 100644 --- a/action.yml +++ b/action.yml @@ -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)