refactor: sanitize GITEA_REGISTRY_VAR input by stripping protocol and path
Some checks failed
Build and Push Docker Image / docker (push) Failing after 5s

This commit is contained in:
2025-09-04 17:23:24 +02:00
parent b0f145c3ba
commit 1a7a4bb0f8

View File

@@ -71,7 +71,8 @@ jobs:
# Prefer explicit var GITEA_REGISTRY; else, use the same host as server URL
if [ -n "${GITEA_REGISTRY_VAR:-}" ]; then
REGISTRY="$GITEA_REGISTRY_VAR"
# Strip protocol and any path if mistakenly provided
REGISTRY=$(echo "$GITEA_REGISTRY_VAR" | sed -E 's#^https?://##; s#/.*$##; s#/$##')
else
# GITHUB_SERVER_URL like https://gitea.example.com
REGISTRY=$(echo "$GITHUB_SERVER_URL" | sed -E 's#^https?://##; s#/$##')