From 5053c629d1f6a5f1c479773eebc3272656ca1a55 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Fri, 24 Jan 2025 21:41:38 +0000 Subject: [PATCH] fix logic error --- action.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/action.yaml b/action.yaml index cd0d3734a2..001b4f237e 100644 --- a/action.yaml +++ b/action.yaml @@ -19,10 +19,12 @@ runs: PROJECT_NAME: ${{ inputs.project_name }} IMAGE_URL: ${{ inputs.image_url }} run: | - if [[ -n $PROJECT_NAME && -n $IMAGE_URL ]]; then + if [[ -n "$PROJECT_NAME" && -n "$IMAGE_URL" ]]; then image_var=$(echo "${PROJECT_NAME}_IMAGE" | tr '[:lower:]' '[:upper:]') echo "${image_var}=$IMAGE_URL" >> ${{ github.action_path }}/.env - elif [[ -z $PROJECT_NAME || -z $IMAGE_URL ]]; then + elif [[ -z $PROJECT_NAME && -z $IMAGE_URL ]]; then + echo "No project name and image URL set. Skipping image configuration." + else echo "You must set both project_name and image_url or unset both." echo "project_name: $PROJECT_NAME, image_url: $IMAGE_URL" exit 1