You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 in PATH. This fails in act runner, but works fine in GitHub Actions.
| ⚠️ Note: '/root/.local/bin' is not on
| your PATH environment variable.
| These apps will not be globally
| accessible until your PATH is
| updated. Run `pipx ensurepath` to
| automatically add it, or manually
| modify your PATH in your shell's
| config file (i.e. ~/.bashrc).
GitHub's image puts $HOME/.local/bin into $PATH. Here's the full path I get by running env 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 use pipx. Since $HOME/.local/bin is an XDG recommendation and is used by more than just pipx, I suspect adding this will fix some other incompatibilities with GitHub Actions as well.
The text was updated successfully, but these errors were encountered:
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.The text was updated successfully, but these errors were encountered: