mirror of
https://github.com/aevea/action-kaniko.git
synced 2025-04-20 00:58:15 +02:00
Omit separator if image is pre-fixed with dash or slash
This commit is contained in:
parent
0e7f380bca
commit
316d744814
1 changed files with 2 additions and 1 deletions
|
@ -36,7 +36,8 @@ ensure "${CONTEXT_PATH}" "path"
|
||||||
|
|
||||||
if [ "$REGISTRY" == "ghcr.io" ]; then
|
if [ "$REGISTRY" == "ghcr.io" ]; then
|
||||||
IMAGE_NAMESPACE="$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')"
|
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 IMAGE="$IMAGE_NAMESPACE$SEPERATOR$IMAGE"
|
||||||
export REPOSITORY="$IMAGE_NAMESPACE$SEPERATOR$REPOSITORY"
|
export REPOSITORY="$IMAGE_NAMESPACE$SEPERATOR$REPOSITORY"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue