From e188b009cbc5e2b6e62e628837843095ed7f5fe3 Mon Sep 17 00:00:00 2001 From: Jonathan Santilli <1774227+jonathansantilli@users.noreply.github.com> Date: Wed, 8 Apr 2026 17:49:06 +0100 Subject: [PATCH] fix: use env command for array execution to support inline var assignments The autofixer test suite uses act to run the action locally and replaces npx --yes mobbdev@latest with API_URL=http://... node .../dist/index.mjs via sed. Bash arrays don't support inline VAR=value command syntax (the VAR=value is treated as a command name, not an env var assignment). The env command handles this correctly, passing the variable to the child process. This works for both: - Normal use: env npx --yes mobbdev@latest review ... - Test override: env API_URL=http://... node .../index.mjs review ... Ref: E-1815 --- action.yml | 2 +- review/action.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 8bcb2a2..342a53a 100644 --- a/action.yml +++ b/action.yml @@ -86,7 +86,7 @@ runs: fi fi - OUT=$("${MOBB_ARGS[@]}") + OUT=$(env "${MOBB_ARGS[@]}") RETVAL=$? if [ $RETVAL -ne 0 ]; then diff --git a/review/action.yml b/review/action.yml index 8bd7fa4..1fc878e 100644 --- a/review/action.yml +++ b/review/action.yml @@ -80,7 +80,7 @@ runs: MOBB_ARGS+=(--mobb-project-name "$MOBB_PROJECT_NAME") fi - OUT=$("${MOBB_ARGS[@]}" || true) + OUT=$(env "${MOBB_ARGS[@]}" || true) OUT=$(echo "$OUT" | tr '\n' ' ') MOBB_URL=$(echo "$OUT" | grep -oE 'https://[^ ]+' | head -1)