From aeaf73e58385d29494e39b909ecd6653ace44077 Mon Sep 17 00:00:00 2001 From: Paulo Gomes Date: Tue, 10 Dec 2024 18:16:41 +0000 Subject: [PATCH] Debug Signed-off-by: Paulo Gomes --- actions/install-slsactl/action.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/actions/install-slsactl/action.yml b/actions/install-slsactl/action.yml index 541c6c3..9949d35 100644 --- a/actions/install-slsactl/action.yml +++ b/actions/install-slsactl/action.yml @@ -41,6 +41,7 @@ runs: if: runner.os == 'Linux' shell: bash run: | + set -x if [[ "${VERSION}" == "latest" ]]; then echo 'Checking what the latest version is' VERSION=$(curl -s 'https://api.github.com/repos/rancherlabs/slsactl/releases/latest' | jq -r '.tag_name') @@ -79,8 +80,12 @@ runs: curl -LO "https://${REPO}/releases/download/${VERSION}/${FILE}" grep "${FILE}" "slsactl_${VERSION#v}_checksums.txt" | sha256sum -c - chmod +x "${FILE}" - sudo mv "${FILE}" /usr/local/bin/slsactl + chmod +x "${FILE}" + if sudo -l &> /dev/null; then + sudo mv "${FILE}" /usr/local/bin/slsactl + else + mv "${FILE}" /usr/local/bin/slsactl + fi env: VERSION: ${{ inputs.version }} REPO: github.com/rancherlabs/slsactl