mirror of
https://github.com/aevea/action-kaniko.git
synced 2025-01-30 22:09:37 +01:00
fix(ghcr): omit separator in case image is prefixed with dash or slash
this allows local pushing to the repo running the action
This commit is contained in:
parent
a95ae7d706
commit
17bff7af73
1 changed files with 5 additions and 3 deletions
|
@ -36,11 +36,13 @@ ensure "${CONTEXT_PATH}" "path"
|
|||
|
||||
if [ "$REGISTRY" == "ghcr.io" ]; then
|
||||
IMAGE_NAMESPACE="$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')"
|
||||
export IMAGE="$IMAGE_NAMESPACE/$IMAGE"
|
||||
export REPOSITORY="$IMAGE_NAMESPACE/$REPOSITORY"
|
||||
# Set `/` separator, unless image is pre-fixed with dash or slash
|
||||
[ -n "$REPOSITORY" ] && [[ ! "$REPOSITORY" =~ ^[-/] ]] && SEPARATOR="/"
|
||||
export IMAGE="$IMAGE_NAMESPACE$SEPARATOR$IMAGE"
|
||||
export REPOSITORY="$IMAGE_NAMESPACE$SEPARATOR$REPOSITORY"
|
||||
|
||||
if [ ! -z $IMAGE_LATEST ]; then
|
||||
export IMAGE_LATEST="$IMAGE_NAMESPACE/$IMAGE_LATEST"
|
||||
export IMAGE_LATEST="$IMAGE_NAMESPACE$SEPARATOR$IMAGE_LATEST"
|
||||
fi
|
||||
|
||||
if [ ! -z $INPUT_CACHE_REGISTRY ]; then
|
||||
|
|
Loading…
Reference in a new issue