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
it looks like the code from gittools-actions-gitversion-setup@v0.9.2 is copied to /actions/ in the container but the action javascript expects the original directory name to be in the path. So the cp should be cp /home/user/.cache/act/gittools-actions-gitversion-setup@v0.9.2 /actions/gittools-actions-gitversion-setup@v0.9.2
I had some hard time with this, too, but after some digging through the code I found out that in order to get the correct dst path you have to provide the path key in the actions/checkout step like this:
I guess this should be better documented in order to save the others the time I had to spend on looking into it.
Reacted by Gabriel Joshua Paet, Tyler, Rowan, Henry Senior, Phillip Parker, David Cabrera, Oromion, Yevgen Nykytenko, Pulkit Kathuria, Christopher Stock and 1 more
Reacted by Gabriel Joshua Paet, Oromion, Christopher Stock and bravo-kernel
This doesn't seem like it would solve the problem - it just changes the destination directory of the initial checkout from /github/workflow/ to /github/workflow/${PATH}
This doesn't seem like it would solve the problem - it just changes the destination directory of the initial checkout from /github/workflow/ to /github/workflow/${PATH}
Yup! And that's how the path provided to cp becomes the one you suggested and the MODULE_NOT_FOUND error is gone. As far as I can understand your issue this seems to be the case. In my situation this was the solution.
So if you check the contents of the copy destination, there is no *.js:
docker exec <act-job-container-name> ls -R /actions/gittools-actions-gitversion-setup@v0.9.2/dist/
A workaround is removing the problematic .gitignore rules in a fork or just deleting .gitignore (which I think act could do before docker cp, @cplee ).
See my fork here: GitTools/actions@master...rstuven:patch-1
You can try it using the action rstuven/actions/gitversion/setup@patch-1 or replicating the change in a fork of your own.
Reacted by Jeremy Lempereur, Rob Cowsill, Seb, Duncan Hall and Samuel Rocha
I had some hard time with this, too, but after some digging through the code I found out that in order to get the correct dst path you have to provide the path key in the actions/checkout step like this:
I guess this should be better documented in order to save the others the time I had to spend on looking into it.
I am currently stuck at the very same thing. I'd like to try your suggestion, but somehow I do not understand what "your-action-root-directory" would be. Could you exemplify which directory I need to put here? And would it be a relative or absolute path on my machine to get act working?
Reacted by Tam Jordan, Michał Grzybek, wujekbogdan, Vincent Renaville and Maksim
I have a similar question. I'm not sure what "your-action-root-directory" is referring to, because I have no custom actions. Here's a repository I'm working with as an example: https://github.com/tamj0rd2/ts-quickfixes
My ci workflow is defined in .github/workflows/ci.yml. Is that the thing the path is supposed to refer to, or is it something else? Can anyone post a working example of their path parameter and their folder structure?
Here's the error output I'm getting:
[CI/Tests-2] ⭐ Run Run headless test
[CI/Tests-2] ☁ git clone 'https://github.com/GabrielBB/xvfb-action' # ref=v1.0
[CI/Tests-2] 🐳 docker cp src=/Users/tamara/.cache/act/GabrielBB-xvfb-action@v1.0 dst=/actions/
[CI/Tests-2] ❗ ::error::Unable to locate executable file: sudo. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
[CI/Tests-2] ❌ Failure - Run headless test
Error: exit with `FAILURE`: 1
Another scenario to help others debug: running this tool in Windows (from Powershell), I received the following error message when I tried to run an action on ubuntu-18.04:
Note the slash confusion. As an alternative, I opened up a WSL2-based bash prompt and installed act inside of the Linux subsystem. This resolved the slash problem. and I no longer get the module not found error.
@rstuven thanks for pointing this out, but I was able to add a !tsconfig.json line to my .gitignore (just in the same repo as the workflow). For some reason tsconfig.json wasn't copied over. So, although you set me on the correct path, I'm not sure if it's still true.
Activity
rdlf0 commentedon May 10, 2020
I had some hard time with this, too, but after some digging through the code I found out that in order to get the correct
dstpath you have to provide thepathkey in theactions/checkoutstep like this:I guess this should be better documented in order to save the others the time I had to spend on looking into it.
pmatheson-greenphire commentedon May 11, 2020
This doesn't seem like it would solve the problem - it just changes the destination directory of the initial checkout from
/github/workflow/to/github/workflow/${PATH}rdlf0 commentedon May 11, 2020
Yup! And that's how the path provided to
cpbecomes the one you suggested and theMODULE_NOT_FOUNDerror is gone. As far as I can understand your issue this seems to be the case. In my situation this was the solution.tachuris commentedon May 16, 2020
The problem is that
docker cpinterprets .gitignore (see current version), in particular the rule that should not ignore the *.js files in dist/:...as if it were a .dockerignore file, which doesn't support exception (
!) rules.So if you check the contents of the copy destination, there is no *.js:
A workaround is removing the problematic .gitignore rules in a fork or just deleting .gitignore (which I think
actcould do beforedocker cp, @cplee ).See my fork here: GitTools/actions@master...rstuven:patch-1
You can try it using the action
rstuven/actions/gitversion/setup@patch-1or replicating the change in a fork of your own.Added documentation for module not found issue. (#256)
ColinM9991 commentedon Jul 11, 2020
I'm currently having this issue with the same described behaviour when it's working with actions for a .NET Core application.
I am developing on a Windows environment and building on a Linux environment.
tyler274 commentedon Aug 2, 2020
similar issue over here too
orihomie commentedon Dec 11, 2020
catthehacker commentedon Dec 11, 2020
@orihomie read https://github.com/nektos/act#default-runners-are-intentionally-incomplete and #107
thomas-schuster commentedon Dec 14, 2020
I am currently stuck at the very same thing. I'd like to try your suggestion, but somehow I do not understand what "your-action-root-directory" would be. Could you exemplify which directory I need to put here? And would it be a relative or absolute path on my machine to get act working?
tamj0rd2 commentedon Jan 1, 2021
I have a similar question. I'm not sure what "your-action-root-directory" is referring to, because I have no custom actions. Here's a repository I'm working with as an example: https://github.com/tamj0rd2/ts-quickfixes
My
ciworkflow is defined in .github/workflows/ci.yml. Is that the thing the path is supposed to refer to, or is it something else? Can anyone post a working example of their path parameter and their folder structure?Here's the error output I'm getting:
catthehacker commentedon Jan 2, 2021
@tamj0rd2 your issue is not related to #228. You are using docker image that doesn't have
sudoincluded.stephenfuqua commentedon Jan 21, 2021
Another scenario to help others debug: running this tool in Windows (from Powershell), I received the following error message when I tried to run an action on
ubuntu-18.04:Error: Cannot find module '/github/workspace/\actions\actions-setup-python@v2\dist\index.js'Note the slash confusion. As an alternative, I opened up a WSL2-based bash prompt and installed
actinside of the Linux subsystem. This resolved the slash problem. and I no longer get the module not found error.catthehacker commentedon Jan 22, 2021
@stephenfuqua that has been fixed in #461
0-sv commentedon Aug 18, 2021
@rstuven thanks for pointing this out, but I was able to add a
!tsconfig.jsonline to my.gitignore(just in the same repo as the workflow). For some reasontsconfig.jsonwasn't copied over. So, although you set me on the correct path, I'm not sure if it's still true.