From a516d1e2a246d5aeca146a9f5dbc59f7fcbba0fa Mon Sep 17 00:00:00 2001 From: Patrik Lundin Date: Wed, 5 Feb 2025 20:19:12 +0100 Subject: [PATCH] Add support for setting --context --- action.yml | 3 +++ entrypoint.sh | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 630e820..7ece903 100644 --- a/action.yml +++ b/action.yml @@ -15,6 +15,9 @@ inputs: workdir: description: 'path to directory where kaniko is executed' default: '' + context: + description: 'path supplied to --context' + default: '' runs: using: docker image: Dockerfile diff --git a/entrypoint.sh b/entrypoint.sh index 7807021..7720844 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -8,5 +8,10 @@ if [ -n "$INPUT_WORKDIR" ]; then printf 'cd %s -> %s\n' "$OLDPWD" "$PWD" fi +context_flag="" +if [ -n "$INPUT_CONTEXT" ]; then + context_flag="--context $INPUT_CONTEXT" +fi + # Build container -/kaniko/executor --dockerfile "$INPUT_DOCKERFILE" --destination "$INPUT_REGISTRY/$INPUT_IMAGE" +/kaniko/executor --dockerfile "$INPUT_DOCKERFILE" --destination "$INPUT_REGISTRY/$INPUT_IMAGE" "$context_flag"