-
Notifications
You must be signed in to change notification settings - Fork 158
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 commands specified as space-separated exe/args #480
Comments
Oh, very interesting project. It might be a good idea to integrate go-shellcheck directly into actionlint in the future once the implementation gets mature. It sounds okay to lex the |
Please do not implement splitting a shell command line by yourself. That's more complicated than you think. Since the result is passed to arguments of an external process, this can be easily a security hall. This patch is not acceptable. From the result of quick research, go-shellwords seems the most reliable lexing implementation. go-shellquote is less famous but better fit to our use case. |
Thanks @rhysd
I execute commands in build scripts with go run specifying a version, such as
Thanks for the note, I realized go-shellwords is used by one of my favorite libraries, goyek, and updated a little more recently than shellquote. Would it be acceptable then to make a patch using the library to make the parsing more robust? |
Sounds reasonable to use
Yes. go-shellwords looks a good choice. Please prefer |
I have packaged shellcheck into a form that can be executed with
go run
https://github.com/wasilibs/go-shellcheck
I'd like to then specify it when running actionlint so that when debugging a CI failure, devs can copy/paste to reproduce the command without any tool installation / version mismatches.
This patch seems to work well with that pattern
https://github.com/rhysd/actionlint/compare/main...anuraaga:process-args?expand=1
Is it something that could be considered for the project? If so, I'll send a PR.
The text was updated successfully, but these errors were encountered: