Skip to content

Commit

Permalink
feat: support latest as an option for the version input (#115)
Browse files Browse the repository at this point in the history
Signed-off-by: purpleclay <purpleclaygh@gmail.com>
  • Loading branch information
purpleclay committed Apr 5, 2024
1 parent 5c13044 commit 6cec00f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
11 changes: 10 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down

0 comments on commit 6cec00f

Please sign in to comment.