-
Notifications
You must be signed in to change notification settings - Fork 67
If GITHUB_ACTIONS is true, the proxy command fails if paths aren't available #257
Description
Describe the bug
The proxy programme seems to do some GitHub Actions 'magic' under the hood which crashes if the files aren't available to the command. This is the case for example if you use a container without mapping the files into the container.
If you run the underlying binary then it all works fine, it's the proxy programme that has this bug. The code responsible seems to be here:
Lines 87 to 91 in 63f3e3e
| outputPath := os.Getenv("GITHUB_OUTPUT") | |
| outputFile, err := os.OpenFile(outputPath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0o644) //nolint | |
| if err != nil { | |
| return nil, err | |
| } |
To Reproduce
In a Github Actions build (or locally in an image and setting GITHUB_ACTIONS to true), use a container using something like taskctl (a task runner which can use Docker contexts).
Try to run terraform, it'll crash.
See Additional context for an example snippet.
Expected behavior
The command should run correctly, if the file doesn't exist then just output to stdout/err etc. as normal. This shouldn't cause the whole proxy to crash...
Screenshots
Environment (please complete the following information):
Inside a container where Github Env files aren't copied in.
OS: Ubuntu (Minimal)
ENV: GITHUB_ACTIONS="true"
tenv version v3.1.0
Additional context
Minimum reproducible code:
$ docker run --rm -it -v $(cygpath -w ${PWD}):/app ensono/eir-infrastructure:1.1.251 pwsh
PowerShell 7.4.4
PS /> ${env:GITHUB_ACTIONS} = $true
PS /> terraform
Failure during /usr/local/tenv/.tenv/Terraform/1.5.7/terraform call : open : no such file or directory
