fix: add orga to K8S_NS generated name

This commit is contained in:
ange 2025-10-04 14:32:49 +00:00
parent eff7472739
commit 4c6d456a1c
Signed by: ange
GPG key ID: 9E0C4157BB7BEB1D

View file

@ -1,14 +1,14 @@
#!/bin/bash -e
# shellcheck disable=SC1091
cd "$INPUT_WORKDIR"
set -a
# shellcheck disable=SC1091
. ./.env
set +a
export K8S_NS;
K8S_NS="$(printf '%s' "${GITHUB_REPOSITORY#*/}-$GITHUB_REF_NAME" \
K8S_NS="$(printf '%s' "${GITHUB_REPOSITORY//\//-}-$GITHUB_REF_NAME" \
| tr '[:upper:]' '[:lower:]' | tr -c '[:lower:][:digit:]-' - \
| sed 's/-\+/-/g; s/^-\+//; s/-$//')"
@ -20,7 +20,7 @@ kubectl config set-context --current --namespace="$K8S_NS"
if [ -n "$INPUT_REGISTRY_PASSWORD" ]; then
kubectl get secret regcred \
|| kubectl create secret docker-registry regcred \
--docker-server="${REGISTRY}" \
--docker-server="$REGISTRY" \
--docker-username="$INPUT_REGISTRY_USERNAME" \
--docker-password="$INPUT_REGISTRY_PASSWORD"
fi