Skip to content

feat(workflow): add support for multiline commands in "run" key#201

Merged
safl merged 1 commit intorefenv:mainfrom
naddinadja-forks:cmdrunner
Dec 18, 2025
Merged

feat(workflow): add support for multiline commands in "run" key#201
safl merged 1 commit intorefenv:mainfrom
naddinadja-forks:cmdrunner

Conversation

@NaddiNadja
Copy link
Contributor

@NaddiNadja NaddiNadja commented Dec 17, 2025

Before, it was not possible to create a workflow steps like:

- name: do_multiple_things 
  run: | 
    cd /some/long/path; \ 
      echo "hello world" > hello.txt; \ 
      cat hello.txt

- name: have_many_arguments 
  run: | 
    ./run_something.sh \ 
      --arg1 value1 \ 
      --arg2 value2 \ 
      --arg2 value3

This could end up forcing users to either have very long lines in the workflow, if many arguments had to be given to a tool, or have a cd prefix for every command in a list of commands if they all had to be executed in a specific directory.

This commit adds multiline support, which follows the syntax of shell scripts where a backslash () continues the command onto the next line.

This will fix #199

@NaddiNadja NaddiNadja force-pushed the cmdrunner branch 2 times, most recently from 9d6dc41 to 9478b3e Compare December 17, 2025 15:45
@coveralls
Copy link

Pull Request Test Coverage Report for Build 20308593984

Details

  • 8 of 8 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.08%) to 78.505%

Totals Coverage Status
Change from base Build 18189340355: 0.08%
Covered Lines: 1589
Relevant Lines: 2090

💛 - Coveralls

@NaddiNadja NaddiNadja requested a review from safl December 18, 2025 09:11
Before, it was not possible to create a workflow steps like:

- name: do_multiple_things
  run: |
    cd /some/long/path; \
      echo "hello world" > hello.txt; \
      cat hello.txt

- name: have_many_arguments
  run: |
    ./run_something.sh \
      --arg1 value1 \
      --arg2 value2 \
      --arg2 value3

This could end up forcing users to either have very long lines in the
workflow, if many arguments had to be given to a tool, *or* have a `cd`
prefix for every command in a list of commands if they all had to be
executed in a specific directory.

This commit adds multiline support, which follows the syntax of shell
scripts where a backslash (\) continues the command onto the next line.

Signed-off-by: Nadja Brix Koch <n.koch@samsung.com>
Copy link
Collaborator

@safl safl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@safl safl merged commit cf7606e into refenv:main Dec 18, 2025
30 checks passed
@NaddiNadja NaddiNadja deleted the cmdrunner branch December 18, 2025 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for multi-line commands in core.cmdrunner

3 participants