From d10ce91a64c52476721a8ec14434ab9874d8e39a Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Wed, 14 Feb 2024 17:04:56 +0300 Subject: [PATCH] fix: fix fetching rc versions of vault cli (#156) Co-authored-by: Mathias Fredriksson --- vault-github/run.sh | 2 +- vault-token/run.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vault-github/run.sh b/vault-github/run.sh index b0f9e0f..13f871e 100644 --- a/vault-github/run.sh +++ b/vault-github/run.sh @@ -34,7 +34,7 @@ unzip_safe() { install() { # Fetch the latest version of Vault if INSTALL_VERSION is 'latest' if [ "$${INSTALL_VERSION}" = "latest" ]; then - LATEST_VERSION=$(curl -s https://releases.hashicorp.com/vault/ | grep -oP 'vault/\K[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1) + LATEST_VERSION=$(curl -s https://releases.hashicorp.com/vault/ | grep -v '-rc' | grep -oP 'vault/\K[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1) printf "Latest version of Vault is %s.\n\n" "$${LATEST_VERSION}" if [ -z "$${LATEST_VERSION}" ]; then printf "Failed to determine the latest Vault version.\n" diff --git a/vault-token/run.sh b/vault-token/run.sh index a4edcd1..cb5125d 100644 --- a/vault-token/run.sh +++ b/vault-token/run.sh @@ -32,7 +32,7 @@ unzip_safe() { install() { # Fetch the latest version of Vault if INSTALL_VERSION is 'latest' if [ "$${INSTALL_VERSION}" = "latest" ]; then - LATEST_VERSION=$(curl -s https://releases.hashicorp.com/vault/ | grep -oP 'vault/\K[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1) + LATEST_VERSION=$(curl -s https://releases.hashicorp.com/vault/ | grep -v '-rc' | grep -oP 'vault/\K[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1) printf "Latest version of Vault is %s.\n\n" "$${LATEST_VERSION}" if [ -z "$${LATEST_VERSION}" ]; then printf "Failed to determine the latest Vault version.\n"