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"