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

Refactor subprocess execution to use @actions/exec #171

Merged
merged 3 commits into from
Oct 19, 2023

Commits on Oct 18, 2023

  1. 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.
    1000hz committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    d647227 View commit details
    Browse the repository at this point in the history
  2. Add changeset

    1000hz committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    76d614f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    473d9cb View commit details
    Browse the repository at this point in the history