feat: support latest as an option for the version input (#115)

Signed-off-by: purpleclay <purpleclaygh@gmail.com>
This commit is contained in:
Purple Clay 2024-04-05 12:27:35 +01:00 committed by GitHub
parent 5c13044a77
commit 6cec00fab9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 1 deletions

View file

@ -44,10 +44,19 @@ runs:
prefix_dir="$(mktemp -d)"
fi
printf '%s/bin' "$prefix_dir" >> $GITHUB_PATH
# If the dagger version is 'latest', set the version back to an empty
# string. This allows the install script to detect and install the latest
# version itself
VERSION=${{ inputs.version }}
if [[ "$VERSION" == "latest" ]]; then
VERSION=
fi
# The install.sh script creates path ${prefix_dir}/bin
cd "$prefix_dir" && { \
curl -sL https://dl.dagger.io/dagger/install.sh 2>/dev/null | \
DAGGER_VERSION=${{ inputs.version }} sh; }
DAGGER_VERSION=$VERSION sh; }
shell: bash
- run: |