refactor(benchmark): use shell: false and quote args in benchmark-compare workflow#68136
Open
herdiyana256 wants to merge 1 commit intoangular:mainfrom
Open
refactor(benchmark): use shell: false and quote args in benchmark-compare workflow#68136herdiyana256 wants to merge 1 commit intoangular:mainfrom
herdiyana256 wants to merge 1 commit intoangular:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
…pare workflow Replace `shell: true` with `shell: false` in the `exec()` utility function to ensure that command arguments are passed directly to the spawned process without shell interpretation. This prevents shell metacharacters in any argument value from being evaluated as shell commands. Additionally, quote the benchmarkTarget step output reference in the benchmark-compare workflow to prevent word-splitting when the value contains spaces or other special characters.
cc04fb1 to
18c437c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, the exec() utility in scripts/benchmarks/utils.mts uses childProcess.spawn() with shell: true. This causes the OS shell to interpret the entire command string, including any arguments, so that special characters within an argument value could alter the intended behavior of the command.
This commit changes the spawn option to shell: false (the Node.js default). With this setting, cmd and args are passed directly to the OS, so each argument is treated as a literal string. Special characters within argument values are not interpreted by any shell.
Additionally, the benchmarkTarget step output in .github/workflows/benchmark-compare.yml is now quoted to prevent unintended word-splitting in the shell run step.
Files changed: