diff --git a/deploy-gitea.sh b/deploy-gitea.sh index a209d7e..a318076 100644 --- a/deploy-gitea.sh +++ b/deploy-gitea.sh @@ -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" \ No newline at end of file +echo "Script completed successfully"