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

@ -27,6 +27,10 @@
version: "0.11.0" version: "0.11.0"
``` ```
### Staying in sync with the `latest` version
By setting the version to `latest`, this action will install the latest version of Dagger.
### All `with:` input parameter options ### All `with:` input parameter options
| Key | Description | Required | Default | | Key | Description | Required | Default |

View file

@ -44,10 +44,19 @@ runs:
prefix_dir="$(mktemp -d)" prefix_dir="$(mktemp -d)"
fi fi
printf '%s/bin' "$prefix_dir" >> $GITHUB_PATH 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 # The install.sh script creates path ${prefix_dir}/bin
cd "$prefix_dir" && { \ cd "$prefix_dir" && { \
curl -sL https://dl.dagger.io/dagger/install.sh 2>/dev/null | \ curl -sL https://dl.dagger.io/dagger/install.sh 2>/dev/null | \
DAGGER_VERSION=${{ inputs.version }} sh; } DAGGER_VERSION=$VERSION sh; }
shell: bash shell: bash
- run: | - run: |