From 34d01b312e6d09965c91f3cad4b855e8a15c4ae4 Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 23 Jul 2026 11:19:10 +0200 Subject: [PATCH] =?UTF-8?q?Obs=C5=82u=C5=BC=20adres=20SSH=20w=20skrypcie?= =?UTF-8?q?=20wydania=20Androida?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/release-android.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/scripts/release-android.sh b/scripts/release-android.sh index 2302e23..5feef52 100755 --- a/scripts/release-android.sh +++ b/scripts/release-android.sh @@ -138,6 +138,14 @@ if [[ "$sanitized_remote" =~ ^(https?)://([^/]+)/(.+)$ ]]; then detected_protocol="${BASH_REMATCH[1]}" detected_host="${BASH_REMATCH[2]}" detected_repository="${BASH_REMATCH[3]%.git}" +elif [[ "$remote_url" =~ ^ssh://([^/@]+@)?([^/:]+)(:[0-9]+)?/(.+)$ ]]; then + detected_protocol="https" + detected_host="${BASH_REMATCH[2]}" + detected_repository="${BASH_REMATCH[4]%.git}" +elif [[ "$remote_url" =~ ^([^/@:]+@)?([^/:]+):(.+)$ ]]; then + detected_protocol="https" + detected_host="${BASH_REMATCH[2]}" + detected_repository="${BASH_REMATCH[3]%.git}" else detected_protocol="https" detected_host="" @@ -147,14 +155,20 @@ fi gitea_base_url="${GITEA_BASE_URL:-${detected_protocol}://${detected_host}}" gitea_repository="${GITEA_REPOSITORY:-$detected_repository}" gitea_base_url="${gitea_base_url%/}" -[[ "$gitea_base_url" =~ ^https?://[^/]+$ ]] || { echo "Ustaw poprawne GITEA_BASE_URL." >&2; exit 1; } +if [[ "$gitea_base_url" =~ ^(https?)://([^/]+)$ ]]; then + gitea_api_protocol="${BASH_REMATCH[1]}" + gitea_api_host="${BASH_REMATCH[2]}" +else + echo "Ustaw poprawne GITEA_BASE_URL." >&2 + exit 1 +fi [[ "$gitea_repository" =~ ^[^/]+/[^/]+$ ]] || { echo "Ustaw poprawne GITEA_REPOSITORY=owner/repository." >&2; exit 1; } auth_args=() if [[ -n "${GITEA_TOKEN:-}" ]]; then auth_args=(-H "Authorization: token $GITEA_TOKEN") else - credential="$(printf 'protocol=%s\nhost=%s\n\n' "$detected_protocol" "$detected_host" | git credential fill)" + credential="$(printf 'protocol=%s\nhost=%s\n\n' "$gitea_api_protocol" "$gitea_api_host" | git credential fill)" gitea_username="$(printf '%s\n' "$credential" | sed -n 's/^username=//p')" gitea_password="$(printf '%s\n' "$credential" | sed -n 's/^password=//p')" [[ -n "$gitea_username" && -n "$gitea_password" ]] || {