Skip to content

Commit 9054f50

Browse files
committed
fix(ci): resolve dispatch fallback tag from stable releases
1 parent 5a006cd commit 9054f50

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,10 @@ jobs:
124124
elif [ -n "$dispatch_tag" ]; then
125125
tag="$dispatch_tag"
126126
else
127-
if ! tag="$(git describe --tags --abbrev=0 2>/tmp/git_describe_error.log)"; then
128-
echo "Failed to resolve tag via git describe. Ensure repository history and tags are available." >&2
129-
cat /tmp/git_describe_error.log >&2 || true
127+
# workflow_dispatch without explicit tag should default to latest stable v-tag.
128+
tag="$(git tag --list 'v*' --sort=-version:refname | grep -E '^v[0-9]+(\.[0-9]+)*$' | head -n1)"
129+
if [ -z "$tag" ]; then
130+
echo "Failed to resolve latest stable v-tag." >&2
130131
exit 1
131132
fi
132133
fi

0 commit comments

Comments
 (0)