Complete Gitea wrapper host resolution
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful

This commit is contained in:
Hermes Agent
2026-06-11 21:00:06 -05:00
parent 9bbf8e3e5d
commit c4c8a255ee
16 changed files with 360 additions and 16 deletions

View File

@@ -248,6 +248,31 @@ get_gitea_login_for_repo_override() {
return 1
}
get_host_from_url() {
local url="${1:-}"
[[ -n "$url" ]] || return 1
python3 - "$url" <<'PY'
import sys
from urllib.parse import urlparse
parsed = urlparse(sys.argv[1])
if parsed.hostname:
print(parsed.hostname)
raise SystemExit(0)
raise SystemExit(1)
PY
}
get_gitea_api_host_for_repo_override() {
if [[ -n "${GITEA_HOST:-}" ]]; then
echo "$GITEA_HOST"
return 0
fi
get_host_from_url "${GITEA_URL:-}"
}
get_gitea_repo_args() {
local repo host login
repo=$(get_repo_slug) || return 1