Fix release labels (#29726)

This commit is contained in:
Stian Thorgersen 2024-05-21 07:46:10 +02:00 committed by GitHub
parent b7a2c2a834
commit ae034fd65f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -31,7 +31,7 @@ jobs:
BACKPORT_LABEL="backport/main"
elif [[ "$GITHUB_BASE_REF" = release/* ]]; then
MAJOR_MINOR="$(echo $GITHUB_BASE_REF | cut -d '/' -f 2)"
LAST_MICRO="$(gh api /repos/$GITHUB_REPOSITORY/tags --jq .[].name | sort -n -r | grep $MAJOR_MINOR | head -n 1 | cut -d '.' -f 3)"
LAST_MICRO="$(gh api /repos/$GITHUB_REPOSITORY/tags --jq .[].name | sort -V -r | grep $MAJOR_MINOR | head -n 1 | cut -d '.' -f 3)"
NEXT_MICRO="$(($LAST_MICRO + 1))"
LABEL="release/$MAJOR_MINOR.$NEXT_MICRO"
BACKPORT_LABEL="backport/$MAJOR_MINOR"