diff --git a/.gitea/workflows/cicd.yaml b/.gitea/workflows/cicd.yaml index 7ecfa6f..7010907 100644 --- a/.gitea/workflows/cicd.yaml +++ b/.gitea/workflows/cicd.yaml @@ -157,7 +157,7 @@ jobs: headers_file="$(mktemp)" if curl -sSI "http://${GITEA_REGISTRY}/v2/" >"${headers_file}"; then realm_url="$(sed -n 's/.*realm="\([^"]*\)".*/\1/p' "${headers_file}" | head -n 1)" - if [ -n "${realm_url}"; then + if [ -n "${realm_url}" ]; then realm_host="$(printf '%s' "${realm_url}" | sed -E 's#^https?://([^/:]+).*$#\1#')" if [ -n "${realm_host}" ] && [ "${realm_host}" != "${GITEA_REGISTRY_HOST}" ]; then if ! grep -q "${realm_host}" /etc/hosts; then