From 1bb6af484b48e993ef15f47820ea20759c248f9b Mon Sep 17 00:00:00 2001 From: Mark Topper Diderichsen Date: Sat, 3 Oct 2026 06:10:24 +0200 Subject: [PATCH] Harden plugin test workflow slug handling --- .github/workflows/test.yml | 10 +++++++--- scripts/test.mjs | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c5eef0c..395cb28 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -95,12 +95,16 @@ jobs: echo "Tooling changed or no specific plugin diff; testing all plugins." echo "slugs=" >> "$GITHUB_OUTPUT" else - echo "Changed plugins:"; printf ' - %s\n' $changed_plugins - echo "slugs=$(printf '%s ' $changed_plugins)" >> "$GITHUB_OUTPUT" + echo "Changed plugins:" + while IFS= read -r slug; do + [ -z "$slug" ] || printf ' - %s\n' "$slug" + done <<< "$changed_plugins" + printf 'slugs=%s\n' "$(printf '%s ' "$changed_plugins")" >> "$GITHUB_OUTPUT" fi - name: Run plugin tests working-directory: plugins-repo env: VITO_PATH: ${{ github.workspace }}/vito - run: node scripts/test.mjs ${{ steps.changed.outputs.slugs }} + PLUGIN_SLUGS: ${{ steps.changed.outputs.slugs }} + run: node scripts/test.mjs diff --git a/scripts/test.mjs b/scripts/test.mjs index 0130e03..35a09af 100644 --- a/scripts/test.mjs +++ b/scripts/test.mjs @@ -45,7 +45,7 @@ import { const TESTS_DIRNAME = "tests"; function parseArgs(argv) { - const slugs = []; + const slugs = (process.env.PLUGIN_SLUGS ?? "").split(/\s+/).filter(Boolean); let vito = process.env.VITO_PATH ?? path.resolve(pluginsDir, "..", "..", "vito"); let filter = null; for (let i = 0; i < argv.length; i += 1) {