From c92462e209b3a6e7e57ee214a2b6ba88657dc082 Mon Sep 17 00:00:00 2001 From: ange Date: Fri, 29 Nov 2024 04:50:52 +0000 Subject: [PATCH] fix: namespace name validation --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index f04b921..7396119 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -6,7 +6,7 @@ set -a set +a REGISTRY="${IMAGEAPP%%/*}" -export K8S_NS; K8S_NS="$(tr '[:upper:]' '[:lower:]' <<< "${GITHUB_REPOSITORY#*/}-$GITHUB_REF_NAME" | tr -c '[:lower:]-' -)" +export K8S_NS; K8S_NS="$(printf '%s' "${GITHUB_REPOSITORY#*/}-$GITHUB_REF_NAME" | tr '[:upper:]' '[:lower:]' | tr -c '[:lower:][:digit:]-' - | sed 's/-\+/-/g; s/^-\+//; s/-$//')" mkdir -p "$HOME/.kube/" echo "$INPUT_KUBECONFIG" > "$HOME/.kube/config"