diff --git a/README.md b/README.md index 54bfb3e..8935101 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,10 @@ 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 | Key | Description | Required | Default | diff --git a/action.yml b/action.yml index ff11bba..71386ef 100644 --- a/action.yml +++ b/action.yml @@ -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: |