Repository navigation
Cache validation for symblic-linked path failed since v3.7.0 #806
Description
Description:
Since v3.7.0, the workflow using actions/setup-node started failing for the error described below.
Our repository uses symblic link for some reason, and v3.7.0 had revised cache resolution logic so that I think this is a kind of regression for the change around:
Lines 144 to 152 in e33196f
| const existingDirectories: string[] = cacheDependenciesPaths | |
| .map(path.dirname) | |
| .filter(unique()) | |
| .filter(directory => fs.lstatSync(directory).isDirectory()); | |
| if (!existingDirectories.length) | |
| core.warning( | |
| `No existing directories found containing cache-dependency-path="${cacheDependencyPath}"` | |
| ); |
I've not confirmed the cause, but I expect that the line .filter(directory => fs.lstatSync(directory).isDirectory()); drops symblic linked.
Action version:
v3.7.0
Platform:
- Ubuntu
- macOS
- Windows
Runner type:
- Hosted
- Self-hosted
Tools version:
- node: v12.13.0
- npm: 612.0
- yarn: 1.22.19
Repro steps:
A description with steps to reproduce the issue. If you have a public example or repo to share, please provide the link.
Setup repository like following structure:
- app (symbolic link -> app-actual)
- app-actual
- .node-version
- package.json
- yarn.lock
- ...
workflow file:
name: test
on:
pull_request:
push:
branches:
- develop
defaults:
run:
working-directory: app
jobs:
test:
runs-on: monorepo-global-amd64
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: "app/.node-version"
- run: npm install -g yarn@1
- uses: actions/setup-node@v3
with:
node-version-file: "app/.node-version"
cache: "yarn"
cache-dependency-path: |
app/yarn.lockExpected behavior:
A description of what you expected to happen.
The 2nd actions/setup-node@v3 step succeeds.
Actual behavior:
The 2nd actions/setup-node@v3 step fails for the error:
Run actions/setup-node@v3
with:
node-version-file: (snip)
cache: yarn
cache-dependency-path: .../yarn.lock
token: ***
always-auth: false
check-latest: false
Node version file is not JSON file
Resolved .../... (snip)
Found in cache @ /home/runner/_work/_tool/node/12.13.0/... (snip)
Environment details
node: v12.13.0
npm: 612.0
yarn: 1.22.19
Warning: No existing directories found containing cache-dependency-path="(snip)"
All dependencies are managed locally by yarn3, the previous cache can be used
Error: Path Validation Error: At least one directory or file path is required
Activity
dusan-trickovic commentedon Jul 11, 2023
Hello @kyontan ! Thank you for reporting the issue, we will take a closer look and see what can be done :)
dmitry-shibanov commentedon Jul 13, 2023
Hello @kyontan. We've merged the pull request with possible fix. Could you please try to use
actions/setup-node@mainto confirm that it works as expected.For now I'm going to reopen the issue.
kyontan commentedon Jul 14, 2023
Hi @dmitry-shibanov,
Our team confirmed that the fix in
actions/setup-node@mainsolved the issue and now our CI is working fine.Thanks for your quick help!
dmitry-shibanov commentedon Aug 15, 2023
Hello @kyontan. The new version of setup-node was released. For now I'm going to close the issue. If you have any concerns feel free to ping us.