uses is for linking a repo, which works in its own directories, that is what is supposed to happen, that's why you cant use working-directory with uses
For anyone struggling with the Node Setup action step, specifically with the uses section when your project is in a sub-folder, you need to add a cache-dependency-path to the with section.
To add to this, if your package.lock.json is in another directory, this would most probably mean that you need to target npm build command to that particular directory by adding the default-directory syntax on your steps or job (depending on your setup)
This doesn't work for
uses
unfortunately.uses
is for linking a repo, which works in its own directories, that is what is supposed to happen, that's why you cant useworking-directory
withuses
For anyone struggling with the Node Setup action step, specifically with the
uses
section when your project is in a sub-folder, you need to add acache-dependency-path
to thewith
section.Example:
To add to this, if your package.lock.json is in another directory, this would most probably mean that you need to target npm build command to that particular directory by adding the
default-directory
syntax on your steps or job (depending on your setup)npm:
runs-on: windows-latest
defaults:
run:
working-directory: ./subdir/
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
cache-dependency-path: ./subdir/package-lock.json