Skip to content

Define proper $HOME variable for GitHub runners to enable tools like uv to store files #1145

@coderabbitai

Description

@coderabbitai

Summary

GitHub runners need a proper $HOME variable to allow tools like uv to store their configuration and cache files. Currently, without a proper GitHub runner home directory, the $HOME variable defaults to the root directory /, and GitHub runners don't have sudo rights to write inside this directory.

Current Situation

We cannot run as the root user due to github action issue
.
We already have necessary workarounds in place:

  • chown $(id -u):$(id -g) -R . to fix dubious ownership
  • --user parameter with GitHub runner UID/GID during the run-on-image action

Important: The chown and --user workarounds must remain as they exist to address the GitHub Actions runner ownership issue (actions/runner-images#6775).

The core issue is that $HOME defaults to / (root directory) when no proper home is defined, and GitHub runners lack sudo privileges to write to this location. This prevents tools like uv from storing their files in appropriate directories.

References on where uv stores files:

Current Solution

  • set HOME=/tmp as a temporary solution
  • Mount the deps image to /mnt/repo

Proposed Solution

Define a proper $HOME directory for GitHub runners:

  • Set $HOME to a writable directory (not /tmp as a temporary measure)
  • Mount the image to $HOME/clp instead of /mnt/repo
  • Ensure tools like uv can store files following the XDG Base Directory Specification

Benefits

  • Tools like uv can properly store configuration and cache files
  • Cleaner CI environment with proper directory structure
  • Eliminates the need for HOME=/tmp workaround
  • Maintains compatibility with existing ownership workarounds

Backlinks

Reported by: @Bill-hbrhbr

Metadata

Metadata

Assignees

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