Description:
**NB:**This issue may only occur when running this action outside of GitHub actions infrastructure.
When running this action with a non-canonical path, such as appears to be happening on my Forgejo setup (see details below), the "import-safe" entrypoints fail to run, printing instead:
the script is loaded as a module, so skipping the execution
The cause seems to be:
- my runner loads actions into
/var/run
/var/run is a symlink to /run
- NodeJS appears to put a canonical path (as in: all symlinks get resolved) into
import.meta.url
process.argv[1] === fileURLToPath(import.meta.url) thus evaluates to false
It'd be fantastic if there were a way to make setup-java work under these circumstances.
Details
Forgejo version: 16.0.3
Forgejo runner version: 13
Image used to run action: ghcr.io/catthehacker/ubuntu:runner-24.04
Task version:
v6
Platform:
Runner type:
Repro steps:
I do not have a simple way to reproduce this, but here's a Dockerfile to demonstrate that import.meta.url contains a canonicalized path:
FROM alpine
RUN apk --no-cache add nodejs
RUN mkdir dir
RUN ln -s dir symlink
RUN echo 'console.log(`process.argv[1]: ${process.argv[1]}`); console.log(`import.meta.url: ${import.meta.url}`)' > dir/test.js
CMD node dir/test.js; node symlink/test.js
Expected behavior:
I expect the action to run normally.
Actual behavior:
The action says it won't run because the "script was loaded as a module"
Description:
**NB:**This issue may only occur when running this action outside of GitHub actions infrastructure.
When running this action with a non-canonical path, such as appears to be happening on my Forgejo setup (see details below), the "import-safe" entrypoints fail to run, printing instead:
The cause seems to be:
/var/run/var/runis a symlink to/runimport.meta.urlprocess.argv[1] === fileURLToPath(import.meta.url)thus evaluates to falseIt'd be fantastic if there were a way to make
setup-javawork under these circumstances.Details
Forgejo version: 16.0.3
Forgejo runner version: 13
Image used to run action: ghcr.io/catthehacker/ubuntu:runner-24.04
Task version:
v6
Platform:
Runner type:
Repro steps:
I do not have a simple way to reproduce this, but here's a
Dockerfileto demonstrate thatimport.meta.urlcontains a canonicalized path:Expected behavior:
I expect the action to run normally.
Actual behavior:
The action says it won't run because the "script was loaded as a module"