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

If GITHUB_ACTIONS is set but paths not available, information message stops terraform output outputs from being usable #286

Open
ElvenSpellmaker opened this issue Nov 20, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ElvenSpellmaker
Copy link

Describe the bug
Based off the back of this bugfix #257 (thank you by the way!), an info message was added to the Proxy Binary to say if the GITHUB_OUTPUT file couldn't be accessed.

The problem with this is that with the message is part of the stdout, which in the case of terraform output means it becomes part of the output of the programme and no further use of the outputs may be used as the message would be interpreted in the converted output.

For example, getting terraform outputs as JSON and then using them as JSON in subsequent code (such as ConvertFrom-Json in pwsh).

To Reproduce
Set the GITHUB_ACTIONS variable but don't have the GITHUB_OUTPUT variable set, or the file missing.
tenv will produce an information message about a missing variable.
This will then pollute the output of the terraform output command.

Try to use the output of the command as JSON in pwsh for example to get this error message:

$result = (terraform output -json | ConvertFrom-Json)

Error:

Conversion from JSON failed with error: Error parsing Infinity value.

This is due to the logged line Ignore GITHUB_ACTIONS, fail to open GITHUB_OUTPUT : open /home/runner/work/_temp/_runner_file_commands/

Expected behavior
The message should probably be on a more verbose logging option, so that the output of terraform output can be used.

Screenshots
image

image

Environment (please complete the following information):

  • OS: N/A
  • tofuenv: 3.2.4

Additional context

Check out #257 which fixed the initial issue (the commands now work rather than bombing out).

@kvendingoldo kvendingoldo added the bug Something isn't working label Nov 20, 2024
@dvaumoron
Copy link
Contributor

What do you think about switching the message to stderr ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants