Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
davseve committed Aug 6, 2023
1 parent eda6add commit e21e3b7
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/get-previous-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e21e3b7

Please sign in to comment.