From b79e752979dcc1ffd4ca7a8900f4a48b47121bfa Mon Sep 17 00:00:00 2001 From: ange Date: Thu, 14 Nov 2024 22:58:18 +0800 Subject: [PATCH] fix: bash syntax doesn't work with sh --- build.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index e1943bb..ebdf890 100755 --- a/build.sh +++ b/build.sh @@ -13,7 +13,10 @@ cat < /kaniko/.docker/config.json } EOF -[ -z "$IMAGEAPP" ] && IMAGEAPP="$${REGISTRY#*://}/$INPUT_IMAGE" +if [ -z "$IMAGEAPP" ]; then + REGISTRY="$(echo "$GITHUB_SERVER_URL" | sed 's .*:// ')" + IMAGEAPP="$REGISTRY/$INPUT_IMAGE" +fi /kaniko/executor \ --cache="${INPUT_CACHE}" \