From e21e3b7105b02756163eb0f9a4fee5270e13c47c Mon Sep 17 00:00:00 2001 From: David Seveloff Date: Sun, 6 Aug 2023 19:13:48 +0300 Subject: [PATCH] WIP --- .../workflows/get-previous-release/action.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/get-previous-release/action.yml b/.github/workflows/get-previous-release/action.yml index 085329c2c10..b3defe234b2 100644 --- a/.github/workflows/get-previous-release/action.yml +++ b/.github/workflows/get-previous-release/action.yml @@ -15,20 +15,19 @@ runs: - shell: bash 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" ) && "${{ inputs.POSTFIX }}" != "-test" ]]; then - tags=$(git ls-remote --tags | grep ${{ inputs.CHANNEL }} | grep -v "\-rc" | grep -v "\-test" | awk '{print $2}') - fi - - # If the channel is "cloud" and the POSTFIX is "-test", fetch all Git tags matching the channel pattern, - if [[ ${{ inputs.CHANNEL }} == "cloud" && "${{ inputs.POSTFIX }}" == "-test" ]]; then - tags=$(git ls-remote --tags | grep ${{ inputs.CHANNEL }} | grep "\-test" | awk '{print $2}') + # excluding any "-rc" and "-test" 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.POSTFIX }}" != "-test" ]]; then + tags=$(git ls-remote --tags | grep ${{ inputs.CHANNEL }} | grep -v "\-rc" | grep -v "\-test" | awk '{print $2}') + elif [[ "${{ inputs.POSTFIX }}" == "-test" ]]; then + tags=$(git ls-remote --tags | grep ${{ inputs.CHANNEL }} | grep "\-test" | awk '{print $2}') + fi 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 - tags=$(git ls-remote --tags | grep "refs/tags/v[0-9]\+\.[0-9]\+\.[0-9]\+$") + tags=$(git ls-remote --tags | grep "refs/tags/v[0-9]\+\.[0-9]\+\.[0-9]\+$") fi # Get the last release of a specific channel (ga, cloud, beta) by datetime descending order