Skip to content

Commit

Permalink
Try to use bash variable indirection
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-blanchard committed Aug 28, 2024
1 parent d2c5ad5 commit f25e165
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ inputs:
description: "S3 or GCS bucket(s) to mount as volumes."
required: false


runs:
using: 'composite'
steps:
Expand Down Expand Up @@ -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[@]}"

0 comments on commit f25e165

Please sign in to comment.