From 0b74179a32178e5646714b455db844f703966f1f 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 | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/action.yml b/action.yml index 5d351e8..db9e8c2 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,18 @@ 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 + + echo "Files on current directory" + ls -lha + + /kaniko/executor --dockerfile Dockerfile --destination "${{ inputs.image }}"