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

Fix output malformed when wrapper enabled #367

Merged
merged 5 commits into from
Oct 27, 2023

Commits on Oct 27, 2023

  1. Fix output malformed when wrapper enabled

    Presently using a command such as `terraform output -json | jq` does not
    work with the wrapper enabled, as it is by default.
    
    In order to consume terraform's output having set it up with this
    Action, it is necessary either to disable the wrapper (`with:
    terraform_wrapper: false`) or run it in its own Actions step with an
    explicit `id` (e.g. `id: foo`) so that it can be referred to and consumed
    (`${{steps.foo.outputs.stdout}}` et al.) in later steps.
    
    This seems to be the result of much confusion (issues passim) and is not
    at all easy (hashicorp#338) to debug/diagnose and come to the realisation that
    it's due to the wrapper, or even that such a thing exists.
    
    @austinvalle identified the issue as being due to the `@actions/exec`
    package writing the spawned command to stdout (along with then its
    actual stdout). This has previously been reported upstream in
    actions/toolkit#649; I've proposed actions/toolkit#1573 to fix it.
    
    This commit aims to address the issue for `setup-terraform` in the
    meantime by silencing `@actions/exec` and then writing out to stdout &
    stderr from the listener buffers, which it writes to without this
    additional logging.
    
    Closes hashicorp#20, hashicorp#80, hashicorp#85, hashicorp#149, hashicorp#338, and probably more.
    OJFord authored and austinvalle committed Oct 27, 2023
    Configuration menu
    Copy the full SHA
    ac70dfc View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    51689ab View commit details
    Browse the repository at this point in the history
  3. update test name

    austinvalle committed Oct 27, 2023
    Configuration menu
    Copy the full SHA
    b503028 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    fd5f36a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    81ee305 View commit details
    Browse the repository at this point in the history