-
Notifications
You must be signed in to change notification settings - Fork 32
Closed
Description
extra-packages allows fetching latest tag of specified package by either not specifying ref or specifying just a tag prefix.
With:
extra-packages: sublimelsp/LSP@4070-it fails to sort the tags properly and returns some old one. Checked with equivalent code in terminal:
git ls-remote --tags --heads https://github.com/sublimelsp/LSP | sed -E -n "s%.*refs/tags/(4070-[0-9]+\.[0-9]+\.[0-9]+)\$%\1%p" | grep -v '\^{}$' | sort -t. -k1,1nr -k2,2nr -k3,3nr | head -n1
4070-1.30.0I think it would need to strip the prefix (4070- in this case or v in some other cases) before sorting. Otherwise it's not sorted correctly. But then the original prefix would have to be also included when returning result.
Relevant code:
UnitTesting/actions/setup/utils.sh
Lines 1 to 19 in 9df1177
| gitResolvePrefixToTag() { | |
| local url="$1" | |
| local prefix="$2" | |
| local refs=$(git ls-remote --tags --heads "$url") | |
| local exact_match=$(echo "$refs" | sed -E -n "s%.*refs/(heads|tags)/($prefix)\$%\2%p" | head -n1) | |
| if [ -n "$exact_match" ]; then | |
| echo "$exact_match" | |
| return 0 | |
| fi | |
| if [ -z "$prefix" ]; then | |
| prefix="v?" | |
| fi | |
| local matched_tags=$(echo "$refs" | sed -E -n "s%.*refs/tags/($prefix[0-9]+\.[0-9]+\.[0-9]+)\$%\1%p" | grep -v '\^{}$') | |
| echo "$matched_tags" | sort -t. -k1,1nr -k2,2nr -k3,3nr | head -n1 | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels