From 6de9caf116c648bf7c4544229e7bc42810c999d5 Mon Sep 17 00:00:00 2001 From: mrhotio <26902309+mrhotio@users.noreply.github.com> Date: Mon, 12 Feb 2024 06:29:27 +0100 Subject: [PATCH] tweak update versions [skip ci] --- update-versions.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/update-versions.sh b/update-versions.sh index bdd50b272..2e60c2d93 100644 --- a/update-versions.sh +++ b/update-versions.sh @@ -1,6 +1,10 @@ #!/bin/bash +old_version=$(jq -re '.version' < VERSION.json) version=$(curl -u "${GITHUB_ACTOR}:${GITHUB_TOKEN}" -fsSL "https://api.github.com/repos/stashapp/stash/releases/latest" | jq -re .tag_name) || exit 1 -json=$(cat VERSION.json) -jq --sort-keys \ - --arg version "${version//v/}" \ - '.version = $version' <<< "${json}" | tee VERSION.json +if [[ "${version}" != "v${old_version}" ]]; then + curl -fsSL "https://github.com/stashapp/stash/releases/download/${version}/stash-linux" -o /dev/null || exit 1 + json=$(cat VERSION.json) + jq --sort-keys \ + --arg version "${version//v/}" \ + '.version = $version' <<< "${json}" | tee VERSION.json +fi