From 453f606a5b4b176af9d2594424e9fb0bb7aa62d6 Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Sat, 27 Jul 2024 23:43:58 -0500 Subject: [PATCH] chore: Download assets using `gh release download` --- action.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/action.yml b/action.yml index b030574..4f0461d 100644 --- a/action.yml +++ b/action.yml @@ -55,19 +55,19 @@ runs: echo "Installing kubedb $VERSION..." DEST="$RUNNER_TEMP/kubedb" - URL="$(jq -r --arg OS "$OS" \ - '.assets[] | select(.name | ascii_downcase | test($OS + "_(amd64|x86_64).(tar.gz|zip)$")) | .url' \ + ASSET="$(jq -r --arg OS "$OS" \ + '.assets[].name | select(ascii_downcase | test($OS + "_(amd64|x86_64).(tar.gz|zip)$"))' \ <<<"$RELEASE" \ )" - echo "Downloading $URL" + echo "Downloading $ASSET" mkdir -p "$DEST" cd "$DEST" - case "$URL" in + case "$ASSET" in *.tar.gz) - curl -sfL "$URL" | tar -xzf - "$FILENAME";; + gh release download "$VERSION" --pattern="$ASSET" --output=- | tar -xzf - "$FILENAME" ;; *.zip) - curl -sfL -o app.zip "$URL" + gh release download "$VERSION" --pattern="$ASSET" unzip app.zip "$FILENAME" rm app.zip ;;