Merge pull request 'Fix build script' (#240) from feat/ci into master

Reviewed-on: #240
This commit is contained in:
Lucas Schwiderski 2025-04-22 14:51:24 +02:00
commit f5940f995e
Signed by: Forgejo (git.sclu1034.dev)
GPG key ID: B1C9C29730D3D366

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'"