fix latest version as latest
Some checks failed
Test STACKIT Auth Action / test (push) Failing after 34s
Some checks failed
Test STACKIT Auth Action / test (push) Failing after 34s
This commit is contained in:
parent
87ef60f2fc
commit
2b97001a94
1 changed files with 8 additions and 2 deletions
10
action.yml
10
action.yml
|
|
@ -30,6 +30,12 @@ runs:
|
||||||
run: |
|
run: |
|
||||||
VERSION="${{ inputs.cli-version }}"
|
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
|
# Detect OS
|
||||||
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
|
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
|
||||||
case "$OS" in
|
case "$OS" in
|
||||||
|
|
@ -50,9 +56,9 @@ runs:
|
||||||
EXT="tar.gz"
|
EXT="tar.gz"
|
||||||
if [ "$OS" = "windows" ]; then EXT="zip"; fi
|
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
|
if [ "$OS" = "windows" ]; then
|
||||||
curl -sL "$URL" -o stackit.zip
|
curl -sL "$URL" -o stackit.zip
|
||||||
unzip -q stackit.zip
|
unzip -q stackit.zip
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue