hashicorp / setup-terraform

Sets up Terraform CLI in your GitHub Actions workflow.
https://developer.hashicorp.com/terraform/tutorials/automation/github-actions
Mozilla Public License 2.0
1.34k stars 235 forks source link

wrapper: Write stdout/stderr data to stream when received #410

Closed austinvalle closed 2 months ago

austinvalle commented 3 months ago

Closes #395 Closes #405

This PR restores the equivalent of the wrapper's original behavior to immediately output to STDOUT and STDERR when data is received. I've attached a demo video of the new delayed test.

Context

Prior to #367, we relied on the @actions/exec package to immediately write to STDOUT and STDERR (which is the default behavior of silent: false), see the relevant underlying code.

Since we can't utilize the @actions/exec package's default behavior, due to the debug/command output being passed to the wrapper (https://github.com/actions/toolkit/issues/649), we can just update our original listener to just write the data as it's being buffered. Shout out to @dannystaple for the original thought!

Demo

https://github.com/hashicorp/setup-terraform/assets/8650838/d0c6a832-a8d0-42e4-a764-384357897e29

github-actions[bot] commented 1 month ago

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.