From 2f06a20b72bb37082c8385da8dea28713a7138f8 Mon Sep 17 00:00:00 2001 From: Victoria Drake <24644237+victoriadrake@users.noreply.github.com> Date: Sat, 18 Mar 2023 09:18:46 -0500 Subject: [PATCH] Update action.sh Updates to how we get the latest Hugo version. Will close #18. --- action.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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