-
Notifications
You must be signed in to change notification settings - Fork 83
Description
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 therun-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:
- https://docs.astral.sh/uv/concepts/cache/#cache-directory
- https://specifications.freedesktop.org/basedir-spec/latest/#basics
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
- Related PR: build(deps): Bump
yscope-dev-utils
to the newest version: #1126 - GitHub Actions issue: fatal: detected dubious ownership in repository at actions/runner-images#6775
- Original comment: build(deps): Bump
yscope-dev-utils
to the newest version: #1126 (comment)
Reported by: @Bill-hbrhbr