Skip to content

HOME is overridden for containers #863

Open
@andreineculau

Description

@andreineculau

Describe the bug
If passing the HOME environment variable to a container configuration,
it will get ignored and set to /github/home anyway as per

container.ContainerEnvironmentVariables["HOME"] = container.TranslateToContainerPath(tempHomeDirectory);

To Reproduce

A workflow with

jobs:
  main:
    runs-on: ubuntu-latest
    container:
      image: 'rokmoln/sf-ubuntu-bionic-common:0.2.80'
      options: '--user sf:sf' # this user's home is /home/sf
      env:
        HOME: /home/sf # tried to change HOME from /github/home to /home/sf. doesn't work
    steps:
      - shell: bash
        run: |
          echo $HOME

will echo /github/home instead of /home/sf.

Expected behavior
Expected HOME to be left as is, as sf user's HOME,
or at the very least to be allowed to enforce it via the env dictionary.

Runner Version and Platform

2.274.2

What's not working?

N/A

Job Log Output

N/A

Runner and Worker's Diagnostic Logs

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions