From a268a6285834db84c316e986504c9be66b86db1a Mon Sep 17 00:00:00 2001 From: David Seveloff Date: Mon, 24 Jul 2023 18:20:12 +0300 Subject: [PATCH] re-add redundant condition from env-vars-conf [ED-11261] --- .github/workflows/env-vars-configure/action.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/env-vars-configure/action.yml b/.github/workflows/env-vars-configure/action.yml index 563a9e76789..8d72c048fc9 100644 --- a/.github/workflows/env-vars-configure/action.yml +++ b/.github/workflows/env-vars-configure/action.yml @@ -30,7 +30,11 @@ runs: # and extracts the version number from the tag name using awk. E.g. retrieves the number 7 from `3.11.0-cloud7`. # If the channel is tagged as a prerelease, than get the latest prerelease version # If the channel is not tagged as a prerelease, than get the latest version which is not a prerelease or an rc - CURRENT_CHANNEL_VERSION=$(git ls-remote --tags | grep -v "\-rc" | grep -v "\-prerelease" | grep -v "refs/tags/v" | grep "${{ inputs.CHANNEL }}" | grep "${{ env.CLEAN_PACKAGE_VERSION }}" | tail -n1 | awk -F'${{ inputs.CHANNEL }}' '{print $2}' || echo 0) + if [[ "${{ inputs.ADDITION_NAME }}" == "-prerelease" ]]; then + CURRENT_CHANNEL_VERSION=$(git ls-remote --tags | grep "\-prerelease" | grep -v "refs/tags/v" | grep "${{ inputs.CHANNEL }}" | grep "${{ env.CLEAN_PACKAGE_VERSION }}" | tail -n1 | awk -F'${{ inputs.CHANNEL }}' '{print $2}' | awk -F'${{ inputs.ADDITION_NAME }}' '{print $1}' || echo 0) + else + CURRENT_CHANNEL_VERSION=$(git ls-remote --tags | grep -v "\-rc" | grep -v "\-prerelease" | grep -v "refs/tags/v" | grep "${{ inputs.CHANNEL }}" | grep "${{ env.CLEAN_PACKAGE_VERSION }}" | tail -n1 | awk -F'${{ inputs.CHANNEL }}' '{print $2}' || echo 0) + fi # If value is not a number (e.g. empty string) then set it to 0 if ! [[ $CURRENT_CHANNEL_VERSION =~ ^[0-9]+$ ]]; then