Skip to content

Commit bf76c59

Browse files
fix: use env command for array execution to support inline var assignments (#33)
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 ...
1 parent a12bce4 commit bf76c59

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ runs:
8686
fi
8787
fi
8888
89-
OUT=$("${MOBB_ARGS[@]}")
89+
OUT=$(env "${MOBB_ARGS[@]}")
9090
9191
RETVAL=$?
9292
if [ $RETVAL -ne 0 ]; then

review/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ runs:
8080
MOBB_ARGS+=(--mobb-project-name "$MOBB_PROJECT_NAME")
8181
fi
8282
83-
OUT=$("${MOBB_ARGS[@]}" || true)
83+
OUT=$(env "${MOBB_ARGS[@]}" || true)
8484
OUT=$(echo "$OUT" | tr '\n' ' ')
8585
MOBB_URL=$(echo "$OUT" | grep -oE 'https://[^ ]+' | head -1)
8686

0 commit comments

Comments
 (0)