Skip to content

init writes a workflow that splits a tests directory containing a space #1425

Open

Description

@Chemaclass

Problem

bashunit init "my tests" writes a workflow that runs the wrong paths in CI. The generated .github/workflows/tests.yml has:

      - uses: TypedDevs/bashunit@v0
        with:
          args: my tests

The action splits args on whitespace on purpose (action.yml:76-80, "$target_dir/bashunit" $BASHUNIT_ARGS), so CI runs bashunit my tests: two paths, my and tests, neither of which is the test directory.

Where

  • src/cli/init.sh: the workflow heredoc writes args: $tests_dir as is.
  • action.yml:76-80: $BASHUNIT_ARGS is split on purpose so callers can pass several arguments in one string. Quoting the value in YAML does not help, because quotes inside the string are not parsed again.

Why it matters

#1411 (PR #1424) makes a directory with a space work locally. The workflow from the same init run still breaks on the first push.

Options

  1. Have init refuse a directory name that contains whitespace, with a clear message.
  2. For such a name, write the workflow without the directory and rely on BASHUNIT_DEFAULT_PATH in .env. This only works when .env is committed, which many projects avoid.
  3. Add an action input that takes one path without splitting it, and have init use it.

Acceptance criteria

  • After bashunit init "my tests", the generated workflow runs the tests in my tests/, or init refuses the name before writing any file.
  • A directory without spaces produces the same workflow as today.
  • A test covers it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions