Open satwell opened 2 months ago
It's easy to add /root/.local/bin
to PATH
in /etc/environment
. But it's not clear to me whether non-root users need to be supported?
Since act runner execs bash with --noprofile --norc
, the only option I can see for expanding $HOME
while setting PATH
is to use BASH_ENV
. Basically, create a file somewhere that contains export PATH="$HOME/.local/bin:$PATH"
and set BASH_ENV
to the location of that file. Then bash will source that script when run non-interactively by act runner.
Which is the better option here? The simple root-only solution, or the more complex but work-for-all-users solution? Happy to contribute a PR for either.
When I try to install Python tools with
pipx
, those tools won't run because they get installed into$HOME/.local/bin
, which isn't inPATH
. This fails in act runner, but works fine in GitHub Actions.Example workflow:
Running this under act runner, pipx complains:
GitHub's image puts
$HOME/.local/bin
into$PATH
. Here's the full path I get by runningenv
on GitHub:Note that they also have custom pipx configuration that makes it put installed executables into
/opt/pipx_bin
, but this isn't strictly needed, at least for basic functionality.I can add a step that runs
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
as a workaround, as explained in the GitHub Action Docs. This works, but it's an extra step that's not usually required on GitHub to usepipx
. Since$HOME/.local/bin
is an XDG recommendation and is used by more than justpipx
, I suspect adding this will fix some other incompatibilities with GitHub Actions as well.