wrangler-action/src
Cina Saffary d647227bbc Refactor subprocess execution to use @actions/exec
Instead of using a mix of `child_process.exec`, `child_process.execSync` and a promisified version of `child_process.exec`, we now (mostly) just use `@actions/exec`. That runs `child_process.spawn` under the hood and handles a lot of character escaping for us. We can also now pass Buffers directly into the subprocess as stdin instead of relying on shell piping.

This ends up fixing a few problems we had where secrets and env var values containing shell metacharacters were being misinterpreted.

Unfortunately, `@actions/exec` doesn't support running with a shell. That means we still have to roll our own wrapper around `child_process.exec` to avoid a breaking change to `preCommands` and `postCommands`, since users might be expecting these to run within a shell.

Also worth noting that we're no longer hiding stdout and stderr from the secret uploading step. We were previously doing this out of an abundance of caution, but it made debugging issues very difficult if secret upload failed for some reason. I feel ok doing this since we're no longer echoing & piping the secret values, wrangler doesn't ever output secret values, and as a last line of defense GitHub masks any secret values that accidentally get logged.
2023-10-18 16:42:34 -05:00
..
exec.ts Refactor subprocess execution to use @actions/exec 2023-10-18 16:42:34 -05:00
index.ts Refactor subprocess execution to use @actions/exec 2023-10-18 16:42:34 -05:00
packageManagers.test.ts Fix code formatting errors 2023-10-10 18:00:40 -05:00
packageManagers.ts Fix code formatting errors 2023-10-10 18:00:40 -05:00
utils.test.ts Refactor to use npm as a fallback if no packageManager specified... 2023-10-09 17:20:09 -05:00
utils.ts Refactor to use npm as a fallback if no packageManager specified... 2023-10-09 17:20:09 -05:00