From 316d74481425c86264127f726dcd0fe4e648e24d Mon Sep 17 00:00:00 2001 From: Mikael Elkiaer <2102306+MikaelElkiaer@users.noreply.github.com> Date: Tue, 31 Jan 2023 10:35:34 +0100 Subject: [PATCH] Omit separator if image is pre-fixed with dash or slash --- entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 08a51f5..52ad2d3 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -36,7 +36,8 @@ ensure "${CONTEXT_PATH}" "path" if [ "$REGISTRY" == "ghcr.io" ]; then IMAGE_NAMESPACE="$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')" - [ -n "$REPOSITORY" ] && SEPERATOR="/" + # Set `/` separator, unless image is pre-fixed with dash or slash + [ -n "$REPOSITORY" ] && [[ ! "$REPOSITORY" =~ ^[-/] ]] && SEPERATOR="/" export IMAGE="$IMAGE_NAMESPACE$SEPERATOR$IMAGE" export REPOSITORY="$IMAGE_NAMESPACE$SEPERATOR$REPOSITORY"