fix(ci): publish container under token account namespace
CI / check (push) Successful in 56s
CI / deploy (push) Successful in 1m9s
CI / publish-container (push) Failing after 30s

This commit is contained in:
Simo committed 2026-09-09 19:53:16 +02:00
1 parent c389c3893d
commit 867113d5d4
5 files changed
+35 -6

No files matched your search

+6
View File
@@ -11,6 +11,12 @@ registry="${registry%/}"
[[ "$REGISTRY_SERVER" = https://* && "$registry" != */* ]] || { echo "Registry must use HTTPS at the Gitea server root" >&2; exit 1; }
repository="${REGISTRY_REPOSITORY,,}"
[[ "$repository" =~ ^[a-z0-9._-]+/[a-z0-9._-]+$ ]] || exit 1
# Gitea packages belong to a user/organization, independently of repository ACLs.
# A collaborator token cannot publish to another user's personal namespace.
namespace="${REGISTRY_NAMESPACE:-$REGISTRY_USER}"
namespace="${namespace,,}"
[[ "$namespace" =~ ^[a-z0-9][a-z0-9._-]*$ ]] || { echo "Invalid registry namespace; use a Gitea username or organization" >&2; exit 1; }
repository="$namespace/${repository#*/}"
image="$registry/$repository:$sha"
# Isolate credentials from the self-hosted runner's normal Docker configuration.
export DOCKER_CONFIG