Skip to content

Commit 8674228

Browse files
fix: fall back to latest git tag when .version file is missing
VERSION variable now resolves from git tags when VERSION_FROM_FILE is empty, so version:resolve-next works on fresh checkouts without a committed .version file. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5c69bae commit 8674228

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Taskfile.variables.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ vars:
4343
VERSION:
4444
sh: |
4545
if [ "${VERSION_OVERRIDE}" = "__TAKEN_FROM_FILE__" ]; then
46-
echo "{{.VERSION_FROM_FILE}}"
46+
from_file="{{.VERSION_FROM_FILE}}"
47+
if [ -n "$from_file" ]; then
48+
echo "$from_file"
49+
else
50+
git tag --sort=-v:refname 2>/dev/null | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -1
51+
fi
4752
else
4853
echo "${VERSION_OVERRIDE}"
4954
fi

0 commit comments

Comments
 (0)