From f25e16518d73848f894dcc8757714fcd2069a8ba Mon Sep 17 00:00:00 2001 From: Dan Blanchard Date: Wed, 28 Aug 2024 12:42:28 -0400 Subject: [PATCH] Try to use bash variable indirection --- action.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 915c7e5..d39f0f8 100644 --- a/action.yml +++ b/action.yml @@ -77,6 +77,7 @@ inputs: description: "S3 or GCS bucket(s) to mount as volumes." required: false + runs: using: 'composite' steps: @@ -104,8 +105,10 @@ runs: run: | args=() for input in name workspace software container vm-type gpu region disk-size keepalive file env subdomain allow-ssh-from port interactive detach sync root forward-gcp-adc tag sync-ignore mount-bucket; do - if [[ -n "${{ inputs.$input }}" ]]; then - args+=("--$input" "${{ inputs.$input }}") + var_name="INPUT_${input^^}" # Convert input to uppercase and prefix with INPUT_ + value="${!var_name}" # Use variable indirection to get the value + if [[ -n "$value" ]]; then + args+=("--$input" "$value") fi done micromamba run -n coiled-run coiled run "${{ inputs.command }}" "${args[@]}" \ No newline at end of file