fix: read git hash outside Docker for Linux build ntfy notification
Some checks failed
Mirror to GitHub / mirror (push) Failing after 39s
Build Release Binaries / build-amd64 (push) Failing after 2m1s

The hash was read inside Docker (/build/source) where .git doesn't
exist. Now reads from $BASE_DIR/data/source before Docker runs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Siavash Sameni
2026-04-08 14:32:03 +04:00
parent b9f4e7f102
commit be0441295a

View File

@@ -70,7 +70,8 @@ find "$BASE_DIR/data/source" "$BASE_DIR/data/cache-linux" \
! -user 1000 -o ! -group 1000 2>/dev/null | \
xargs -r chown 1000:1000 2>/dev/null || true
notify "WZP Linux x86_64 build started..."
GIT_HASH=$(cd "$BASE_DIR/data/source" && git rev-parse --short HEAD 2>/dev/null || echo "unknown")
notify "WZP Linux x86_64 build started [$GIT_HASH]..."
echo ">>> Building in Docker..."
docker run --rm --user 1000:1000 \
@@ -114,8 +115,7 @@ docker run --rm \
URL=$(curl -s -F "file=@/tmp/wzp-linux-x86_64.tar.gz" -H "Authorization: $rusty_auth_token" "$rusty_address")
if [ -n "$URL" ]; then
echo "UPLOAD_URL=$URL"
GIT_HASH=$(cd /build/source && git rev-parse --short HEAD 2>/dev/null || echo unknown)
notify "WZP Linux x86_64 [$GIT_HASH] ready! $URL"
notify "WZP Linux x86_64 [$GIT_HASH] ready! $URL"
echo ">>> Done! Binaries at: $URL"
else
notify "WZP Linux build FAILED - upload error"