From 37f9f7c85a1e823a30122daf17087fa43e47adf2 Mon Sep 17 00:00:00 2001 From: "ekin.tertemiz" Date: Wed, 7 Oct 2026 20:38:10 +0200 Subject: [PATCH] add support for multiple build args --- action.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/action.yaml b/action.yaml index 4525ede..a162fd6 100644 --- a/action.yaml +++ b/action.yaml @@ -28,6 +28,10 @@ inputs: description: 'Custom path for Kaniko cache layers' required: false default: '' + build_args: + description: 'Optional build arguments separated by spaces or newlines (e.g., KEY=VAL)' + required: false + default: '' runs: using: 'composite' @@ -56,11 +60,19 @@ runs: CACHE_REPO_ARG="${{ inputs.cache_repo }}" fi + DYNAMIC_BUILD_ARGS="" + if [ -n "${{ inputs.build_args }}" ]; then + for arg in ${{ inputs.build_args }}; do + DYNAMIC_BUILD_ARGS="$DYNAMIC_BUILD_ARGS --build-arg=$arg" + done + fi + # 5. Fire Kaniko executor /kaniko/executor \ --context="dir://${{ forgejo.workspace }}" \ --dockerfile="${{ forgejo.workspace }}/${{ inputs.dockerfile_path }}" \ $TARGET_ARG \ + $DYNAMIC_BUILD_ARGS \ --destination="$REGISTRY_DOMAIN/${{ inputs.destination_image }}:${{ inputs.image_tag }}" \ --cache=true \ --cache-repo="$CACHE_REPO_ARG" \