🐛 Override `$HOME` in the container with `/root`

This is necessary to let `python -m site` locate the real install
directories.
This fixes #115 — the bug caused by GitHub passing the value of
`$HOME` from the host system that does not match the container's
expectations.
This commit is contained in:
Sviatoslav Sydorenko 2022-12-07 02:41:32 +01:00
parent 644926c972
commit c7f29f7ade
No known key found for this signature in database
GPG Key ID: 9345E8FEA89CA455
1 changed files with 1 additions and 0 deletions

View File

@ -11,6 +11,7 @@ set -Eeuo pipefail
# NOTE: These variables are needed to combat GitHub passing broken env vars # NOTE: These variables are needed to combat GitHub passing broken env vars
# NOTE: from the runner VM host runtime. # NOTE: from the runner VM host runtime.
# Ref: https://github.com/pypa/gh-action-pypi-publish/issues/112 # Ref: https://github.com/pypa/gh-action-pypi-publish/issues/112
export HOME="/root" # So that `python -m site` doesn't get confused
export PATH="/usr/bin:${PATH}" # To find `id` export PATH="/usr/bin:${PATH}" # To find `id`
. /etc/profile # Makes python and other executables findable . /etc/profile # Makes python and other executables findable
export PATH="$(python -m site --user-base)/bin:${PATH}" export PATH="$(python -m site --user-base)/bin:${PATH}"