Fix build script

This commit is contained in:
Lucas Schwiderski 2025-04-22 14:50:37 +02:00
parent 60d9ec0580
commit 5bb0f2acf5
Signed by: lucas
GPG key ID: AA12679AAA6DF4D8

View file

@ -20,14 +20,15 @@ install_artifact() {
cd "repo" cd "repo"
PR=${PR:-} PR=${PR:-}
ref=$(cat .git/ref || echo "HEAD")
if [ -n "$PR" ]; then if [ -n "$PR" ]; then
title "PR: $(echo "$PR" | jq '.number') - $(echo "$PR" | jq '.title')" 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')" ref="pr-$(echo "$PR" | jq '.number')-$(git rev-parse --short "$ref" 2>/dev/null || echo 'manual')"
elif [ -f ".git/branch" ]; then elif [ -f ".git/branch" ]; then
ref=$(cat .git/branch)-$(git rev-parse --short $ref) ref=$(cat .git/branch)-$(git rev-parse --short "$ref")
else else
ref=$(git rev-parse --short "$(cat .git/ref || echo "HEAD")") ref=$(git rev-parse --short "$ref")
fi fi
title "Version: '$ref'" title "Version: '$ref'"