Fix using branch for version number #209

Merged
lucas merged 1 commit from issue/205 into master 2025-03-12 13:25:50 +01:00
Showing only changes of commit 6ba13ac1ec - Show all commits

View file

@ -24,13 +24,10 @@ PR=${PR:-}
if [ -n "$PR" ]; then
title "PR: $(echo "$PR" | jq '.number') - $(echo "$PR" | jq '.title')"
ref="pr-$(echo "$PR" | jq '.number')-$(git rev-parse --short "$(cat .git/ref || echo "HEAD")" 2>/dev/null || echo 'manual')"
elif [ -f ".git/branch"]; then
ref=$(cat .git/branch)-$(git rev-parse --short $ref)
else
ref=$(cat .git/ref || echo "HEAD")
branch=$(git rev-parse --abbrev-ref $ref)
if [ -z "$branch" ]; then
branch=$(cat .git/ref)
fi
ref=${branch}-$(git rev-parse --short $ref)
ref=$(git rev-parse --short "$(cat .git/ref || echo "HEAD")")
fi
title "Version: '$ref'"