Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support piped commands #346

Open
lstocchi opened this issue Feb 18, 2020 · 2 comments
Open

Support piped commands #346

lstocchi opened this issue Feb 18, 2020 · 2 comments
Labels
enhancement New feature or request exec

Comments

@lstocchi
Copy link

Describe the enhancement
Support pipes | to redirect stdout of first toolrunner to the next one.

Code Snippet
An idea could be to have a method that connects a list of ToolRunners and start executing them ToolRunner.execWithPiping(trs: ToolRunner[])

Additional information
If i have a sequence of commands like tr1 | tr2 | tr3 i would like to redirect stdout through all tollrunners. (e.g. kubectl create deployment my-dep -o yaml --dry-run | kubectl label --local -f - environment=qa -o yaml | kubectl create -f - )

I am also available to contribute on this if there is no workaround to achieve this and you want to add this feature.

@sittie82
Copy link

An idea could be to have a method that connects a list and start executing them ToolRunner.execWithPiping(trs: ToolRunne)

rickstaa added a commit to reviewdog/action-flake8 that referenced this issue Dec 10, 2020
Due to a bug in the @actions/exec package piping of commands is
currently not supported. I therefore had to use the workarround that is
given in actions/toolkit#346.
@rickstaa
Copy link

rickstaa commented Dec 12, 2020

Related to #461, #359. This would be a very nice feature to have! 🚀 I currently use the following workaround that was given in #359 by @hrueger.

LINUX/MAC:

exec.exec(`/bin/bash -c "my command"`)

WINDOWS:

exec.exec(`cmd /c "my command"`)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request exec
Projects
None yet
Development

No branches or pull requests

5 participants
@rickstaa @lstocchi @thboop @sittie82 and others