diff --git a/.github/workflows/env-vars-configure/action.yml b/.github/workflows/env-vars-configure/action.yml index 3be66ab1283..9e512cb80f3 100644 --- a/.github/workflows/env-vars-configure/action.yml +++ b/.github/workflows/env-vars-configure/action.yml @@ -28,11 +28,11 @@ runs: run: | # This command retrieves the latest tag that matches the specified channel and package version, # and extracts the version number from the tag name using awk. E.g. retrieves the number 7 from `3.11.0-cloud7`. - CURRENT_CHANNEL_VERSION=$(git ls-remote --tags | grep -v "\-rc" | grep -v "refs/tags/v" | grep "${{ inputs.CHANNEL }}" | grep "${{ env.CLEAN_PACKAGE_VERSION }}" | tail -n1 | awk -F'${{ inputs.CHANNEL }}' '{print $2}' || echo 0) - # If the channel is prerelease, then get the latest prerelease version 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}' || echo 0) + else + CURRENT_CHANNEL_VERSION=$(git ls-remote --tags | grep -v "\-rc" | 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 diff --git a/.github/workflows/get-previous-release/action.yml b/.github/workflows/get-previous-release/action.yml index 3f5373efae7..070a308c517 100644 --- a/.github/workflows/get-previous-release/action.yml +++ b/.github/workflows/get-previous-release/action.yml @@ -13,10 +13,14 @@ runs: run: | # If the channel is either "cloud" or "beta", fetch all Git tags matching the channel pattern, # excluding any "-rc" tags, and store them in the 'tags' variable. e.g. "refs/tags/v3.11.0-cloud1 , refs/tags/v3.11.0-cloud2" - if [[ ${{ inputs.CHANNEL }} == "cloud" || ${{ inputs.CHANNEL }} == "beta" ]]; then + if [[ ${{ inputs.CHANNEL }} == "cloud" || ${{ inputs.CHANNEL }} == "beta" && ${{ env.ADDITION_NAME }} == "-prerelease" ]]; then tags=$(git ls-remote --tags | grep ${{ inputs.CHANNEL }} | grep -v "\-rc" | awk '{print $2}') fi + if [[ ${{ inputs.CHANNEL }} == "cloud" && ${{ env.ADDITION_NAME }} == "-prerelease" ]]; then + tags=$(git ls-remote --tags | grep ${{ inputs.CHANNEL }} | grep "\-prerelease" | awk '{print $2}') + fi + # If the channel is "ga", fetch all Git tags matching the semantic versioning pattern "vX.Y.Z" # and store them in the 'tags' variable. e.g. "refs/tags/v3.11.1 , refs/tags/v3.11.2" if [[ ${{ inputs.CHANNEL }} == "ga" ]]; then