diff --git a/action.yml b/action.yml index 61b7bd2..7b92b92 100644 --- a/action.yml +++ b/action.yml @@ -30,6 +30,12 @@ runs: run: | VERSION="${{ inputs.cli-version }}" + if [ "$VERSION" = "latest" ]; then + VERSION=$(curl -s https://api.github.com/repos/stackitcloud/stackit-cli/releases/latest | jq -r '.tag_name') + else + VERSION="v$VERSION" + fi + # Detect OS OS=$(uname -s | tr '[:upper:]' '[:lower:]') case "$OS" in @@ -50,9 +56,9 @@ runs: EXT="tar.gz" if [ "$OS" = "windows" ]; then EXT="zip"; fi - URL="https://github.com/stackitcloud/stackit-cli/releases/download/v${VERSION}/stackit-cli_${VERSION}_${OS}_${ARCH}.${EXT}" + URL="https://github.com/stackitcloud/stackit-cli/releases/download/${VERSION}/stackit-cli_${VERSION}_${OS}_${ARCH}.${EXT}" - echo "Downloading STACKIT CLI v${VERSION} for ${OS}/${ARCH}..." + echo "Downloading STACKIT CLI ${VERSION} for ${OS}/${ARCH}..." if [ "$OS" = "windows" ]; then curl -sL "$URL" -o stackit.zip unzip -q stackit.zip