From 03e09e45eb301d0a0e74166197eb4e38c97b15b1 Mon Sep 17 00:00:00 2001 From: Jonathan Santilli <1774227+jonathansantilli@users.noreply.github.com> Date: Wed, 8 Apr 2026 19:18:14 +0100 Subject: [PATCH] fix: split MOBB_EXEC from MOBB_ARGS for test tooling compatibility The autofixer CI uses sed to replace `npx --yes mobbdev@latest` with `API_URL=http://... node .../dist/index.mjs` in action.yml. With a single MOBB_ARGS array, the sed replacement puts `API_URL=... node .../index.mjs` as part of the first array element, and `env` treats the whole thing as one var assignment instead of separating the env var from the command. Splitting into MOBB_EXEC (the npx command, sed-replaceable) and MOBB_ARGS (the flags/arguments) ensures that after sed replacement, `env` correctly handles `API_URL=...` as a var and `node` as the command. Ref: E-1815 --- action.yml | 7 +++++-- review/action.yml | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index 342a53a..fdfd071 100644 --- a/action.yml +++ b/action.yml @@ -45,8 +45,11 @@ runs: echo "REPO: $REPO" echo "BRANCH: $BRANCH" + # npx --yes mobbdev@latest is kept on its own line so test tooling + # (autofixer CI) can sed-replace it with a local build command. + MOBB_EXEC=(npx --yes mobbdev@latest) MOBB_ARGS=( - npx --yes mobbdev@latest analyze --ci + analyze --ci -r "$REPO" --ref "$BRANCH" --api-key "$MOBB_API_KEY" @@ -86,7 +89,7 @@ runs: fi fi - OUT=$(env "${MOBB_ARGS[@]}") + OUT=$(env "${MOBB_EXEC[@]}" "${MOBB_ARGS[@]}") RETVAL=$? if [ $RETVAL -ne 0 ]; then diff --git a/review/action.yml b/review/action.yml index 1fc878e..b5e8d3d 100644 --- a/review/action.yml +++ b/review/action.yml @@ -62,8 +62,11 @@ runs: echo "COMMIT_HASH: $COMMIT_HASH" echo "PR_NUMBER: $PR_NUMBER" + # npx --yes mobbdev@latest is kept on its own line so test tooling + # (autofixer CI) can sed-replace it with a local build command. + MOBB_EXEC=(npx --yes mobbdev@latest) MOBB_ARGS=( - npx --yes mobbdev@latest review + review -r "$REPO" --ref "$GITHUB_HEAD_REF" --ch "$COMMIT_HASH" @@ -80,7 +83,7 @@ runs: MOBB_ARGS+=(--mobb-project-name "$MOBB_PROJECT_NAME") fi - OUT=$(env "${MOBB_ARGS[@]}" || true) + OUT=$(env "${MOBB_EXEC[@]}" "${MOBB_ARGS[@]}" || true) OUT=$(echo "$OUT" | tr '\n' ' ') MOBB_URL=$(echo "$OUT" | grep -oE 'https://[^ ]+' | head -1)