diff --git a/action.sh b/action.sh index 0ee353d..3283c38 100755 --- a/action.sh +++ b/action.sh @@ -18,10 +18,9 @@ echo '🔧 Install tools' npm init -y && npm install -y postcss postcss-cli autoprefixer echo '🤵 Install Hugo' -HUGO_VERSION=$(curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | jq -r '.tag_name') mkdir tmp/ && cd tmp/ -curl -sSL https://github.com/gohugoio/hugo/releases/download/${HUGO_VERSION}/hugo_extended_${HUGO_VERSION: -7}_Linux-64bit.tar.gz | tar -xvzf- -mv hugo /usr/local/bin/ +curl -sSL $(curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | grep "browser_download_url.*\hugo_extended.*\_Linux-64bit.tar.gz" | rev | cut -d ' ' -f 1 | rev | tr -d '"') | tar -xvzf- +sudo mv hugo /usr/local/bin/ cd .. && rm -rf tmp/ cd ${GITHUB_WORKSPACE} hugo version || exit 1