Skip to content

Commit f15a558

Browse files
committed
simplify: use git ls-remote consistently for version detection
- Remove git describe fallback complexity - Always use git ls-remote for consistency with PowerShell script - More reliable in CI environments and shallow clones
1 parent 2e07a37 commit f15a558

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

updater/tests/workflow-args.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,20 @@ set -euo pipefail
66
case $1 in
77
get-version)
88
# Return the actual latest tag to ensure no update is needed
9-
git describe --tags --abbrev=0
9+
# Always use remote lookup for consistency with update-dependency.ps1
10+
tags=$(git ls-remote --tags --refs https://github.com/getsentry/github-workflows.git | \
11+
sed 's/.*refs\/tags\///' | \
12+
grep -E '^v?[0-9.]+$')
13+
14+
# Sort by version number, handling mixed v prefixes
15+
latest=$(echo "$tags" | sed 's/^v//' | sort -V | tail -1)
16+
17+
# Check if original had v prefix and restore it
18+
if echo "$tags" | grep -q "^v$latest$"; then
19+
echo "v$latest"
20+
else
21+
echo "$latest"
22+
fi
1023

1124
# Run actual tests here.
1225
if [[ "$(uname)" != 'Darwin' ]]; then

0 commit comments

Comments
 (0)