Update deploy-gitea.sh
Some checks failed
Check Latest Release / deploy (push) Failing after 1m53s
Deploy from Main / deploy (push) Failing after 2m0s

This commit is contained in:
zramsay 2025-11-28 20:54:52 +00:00
parent a14ec7d9ca
commit 4dbd379197

View File

@ -26,10 +26,10 @@ REF="$2"
REPO="https://git.vdb.to/${REPO_PATH}"
# Get the commit hash - try as branch first, then as tag
COMMIT_HASH=$(curl -s "https://git.vdb.to/api/v1/repos/${REPO_PATH}/commits/${REF}" | jq -r '.sha')
COMMIT_HASH=$(curl -s "https://git.vdb.to/api/v1/repos/${REPO_PATH}/branches/${REF}" | jq -r '.commit.id')
if [ -z "$COMMIT_HASH" ] || [ "$COMMIT_HASH" = "null" ]; then
# Fall back to tag lookup
COMMIT_HASH=$(curl -s "https://git.vdb.to/api/v1/repos/${REPO_PATH}/git/refs/tags/${REF}" | jq -r '.object.sha')
COMMIT_HASH=$(curl -s "https://git.vdb.to/api/v1/repos/${REPO_PATH}/tags/${REF}" | jq -r '.commit.sha')
if [ -z "$COMMIT_HASH" ] || [ "$COMMIT_HASH" = "null" ]; then
echo "Error: Could not find commit hash for ref $REF"
exit 1
@ -134,4 +134,4 @@ fi
# Cleanup
rm -f $RECORD_FILE $CONFIG_FILE
echo "Script completed successfully"
echo "Script completed successfully"