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 true, the proxy command fails if paths aren't available #257

Closed
ElvenSpellmaker opened this issue Sep 29, 2024 · 1 comment · Fixed by #260
Closed

Comments

@ElvenSpellmaker
Copy link

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:

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

image

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
@dvaumoron
Copy link
Contributor

I think, we can log instead of stop for this kind of error. I will do that soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants