Skip to content

If GITHUB_ACTIONS is true, the proxy command fails if paths aren't available #257

@ElvenSpellmaker

Description

@ElvenSpellmaker

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions