File tree Expand file tree Collapse file tree 1 file changed +24
-2
lines changed
Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Original file line number Diff line number Diff line change 2121 - name : Get the latest tag
2222 id : get_latest_tag
2323 run : |
24- git fetch --tags
25- latest_tag=$(git tag -l | sort -V | tail -n 1)
24+ git fetch --tags
25+
26+ # Get the most recent tag (including RC candidates) to determine the latest version
27+ most_recent_tag=$(git tag -l | sort -V | tail -n 1)
28+ echo "most recent tag: $most_recent_tag"
29+
30+ # Extract the base version (remove rc/alpha/beta suffixes)
31+ base_version=$(echo "$most_recent_tag" | sed -E 's/-?(rc|alpha|beta)[0-9]*$//')
32+ echo "base version: $base_version"
33+
34+ # Look for a stable release of this base version
35+ echo "Looking for exact match of: '$base_version'"
36+ stable_tag=$(git tag -l | grep "^$base_version$" | head -n 1)
37+ echo "stable tag found: '$stable_tag'"
38+
39+ # If we found a stable version, use it; otherwise use the most recent tag
40+ if [ -n "$stable_tag" ]; then
41+ latest_tag="$stable_tag"
42+ echo "found stable version: $stable_tag"
43+ else
44+ latest_tag="$most_recent_tag"
45+ echo "using most recent tag: $most_recent_tag"
46+ fi
47+
2648 echo "latest tag: $latest_tag"
2749 echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV
2850
You can’t perform that action at this time.
0 commit comments