-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue: Docker env PATH lost #896
Comments
fixes nektos#896 Signed-off-by: hackercat <[email protected]>
This also effects https://github.com/SonarSource/sonarcloud-github-action I tried https://github.com/catthehacker/act-fork/tree/vNext for semgrep and sonarcloud; both not working. |
I have the exact same issue. Has anyone found a workaround? |
My workaround is to add a layer which puts symlinks in /usr/bin |
This affects even SonarSource/sonarqube-scan-action. I wanted to report that the workaround proposed by @jayvdb works in this case, too (sonarqube-scan-action patched fork). |
A simple workaround is to manually set the PATH in the env parameter of the step. For sonarqube-scan-action:
You can find the expected PATH in env by inspecting the image with the command |
For others:
Ideally, one should be setting the entire environment as it was left by the job, but that's a bit more work. |
@vHanda I assume this issue has been fixed with #1503 Could you try to use the master branch of act and test if you are still facing issues? Test binaries of the master branch can be found here: https://github.com/nektos/act/actions/runs/4126476541 |
@ChristopherHX this is still an issue for me on 0.2.44. Just running an action that prints $PATH gives: Whereas in the runner image, $PATH is something like: This prevents me from running any commands that are preinstalled in my image. |
@scottjasso Running this docker action (Dockerfile action) FROM ubuntu:latest
ENV PATH "/mycustom:$PATH"
ENTRYPOINT "env" OUTPUTS
Remember only environment variables defined by |
Ahh, I see. Our PATH is set in |
@ChristopherHX can i add to a path from act cmdline via —env ? |
System information
act
: mediumact
version: master and 0.2.24Expected behaviour
I am running https://github.com/returntocorp/semgrep-action locally using
act
, and its Dockerfile envPATH
addition of/root/.local/bin
is being disregarded, so that it can not find commands that are available when running the docker image directly.https://github.com/returntocorp/semgrep-action/issues/428 covers my initial analysis, showing that the PATH doesnt contain the necessary component, and oddly includes
/usr/games:/usr/local/games:/snap/bin
- I cant find where those come from.Actual behaviour
The PATH is wrong.
Workflow and/or repository
https://github.com/jayvdb/dns-cache/blob/master/.github/workflows/semgrep.yml
Note this is the default semgrep GitHub action yml, and I've verified this problem occurs on several repos.
Steps to reproduce
act -j semgrep
act
outputLog
The text was updated successfully, but these errors were encountered: