Update deploy-gitea.sh
This commit is contained in:
parent
a14ec7d9ca
commit
4dbd379197
@ -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"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user