Skip to content

Commit 5e47e12

Browse files
authored
Merge pull request #53344 from nextcloud/backport/53341/stable31
2 parents 0f03957 + 8ee36d7 commit 5e47e12

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

.github/workflows/generate-release-changelog.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)