refactor: sanitize GITEA_REGISTRY_VAR input by stripping protocol and path
Some checks failed
Build and Push Docker Image / docker (push) Failing after 5s
Some checks failed
Build and Push Docker Image / docker (push) Failing after 5s
This commit is contained in:
@@ -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#/$##')
|
||||
|
||||
Reference in New Issue
Block a user