File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -42,12 +42,20 @@ jobs:
4242 run : |
4343 cd server
4444 # Print all tags
45- git log --decorate --oneline | egrep '^[0-9a-f]+ \((HEAD, )? tag: ' | sed -r 's/^.+tag: ([^ ]+)[,\)].+$/\1/g'
45+ git log --decorate --oneline | egrep 'tag: ' | sed -r 's/^.+tag: ([^,\) ]+)[,\)].+$/\1/g'
4646 # Get the current tag
47- TAGS=$(git log --decorate --oneline | egrep '^[0-9a-f]+ \((HEAD, )? tag: ' | sed -r 's/^.+tag: ([^ ]+)[,\)].+$/\1/g')
47+ TAGS=$(git log --decorate --oneline | egrep 'tag: ' | sed -r 's/^.+tag: ([^,\) ]+)[,\)].+$/\1/g')
4848 CURRENT_TAG=$(echo "$TAGS" | head -n 1)
49- # Get the previous tag that is not an rc, beta or alpha
50- PREVIOUS_TAG=$(echo "$TAGS" | grep -v 'rc\|beta\|alpha' | sed -n '2p')
49+
50+ # Get the previous tag - filter pre-releases only if current tag is stable
51+ if echo "$CURRENT_TAG" | grep -q 'rc\|beta\|alpha'; then
52+ # Current tag is pre-release, don't filter
53+ PREVIOUS_TAG=$(echo "$TAGS" | sed -n '2p')
54+ else
55+ # Current tag is stable, filter out pre-releases
56+ PREVIOUS_TAG=$(echo "$TAGS" | grep -v 'rc\|beta\|alpha' | sed -n '2p')
57+ fi
58+
5159 echo "CURRENT_TAG=$CURRENT_TAG" >> $GITHUB_ENV
5260 echo "PREVIOUS_TAG=$PREVIOUS_TAG" >> $GITHUB_ENV
5361
You can’t perform that action at this time.
0 commit comments