Skip to content

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

@ElvenSpellmaker

Description

@ElvenSpellmaker

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions