From 4496efe737a64d24087e12f04d7d9573032b8e15 Mon Sep 17 00:00:00 2001 From: Leandro Costa Date: Tue, 17 Jun 2025 12:20:18 -0300 Subject: [PATCH] feat: read Dockerfile from local file system --- action.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/action.yml b/action.yml index 5d351e8..04c5a8c 100644 --- a/action.yml +++ b/action.yml @@ -2,9 +2,9 @@ name: Kaniko description: Build a container image using Kaniko inputs: - Dockerfile: + dockerfile: description: The Dockerfile to pass to Kaniko - required: true + required: false image: description: Name and tag under which to upload the image required: true @@ -27,7 +27,15 @@ runs: - | mkdir -p /kaniko/.docker echo '{"auths":{"${{ inputs.registry }}":{"auth":"'$(printf "%s:%s" "${{ inputs.username }}" "${{ inputs.password }}" | base64 | tr -d '\n')'"}}}' > /kaniko/.docker/config.json - cat > Dockerfile < Dockerfile + elif [ -f "./Dockerfile" ]; then + echo "Using existing ./Dockerfile from workspace" + else + echo "ERROR: No Dockerfile provided and no ./Dockerfile found in workspace" + exit 1 + fi + + /kaniko/executor --dockerfile Dockerfile --destination "${{ inputs.image }}"