Skip to content

Cache validation for symblic-linked path failed since v3.7.0 #806

Description

@kyontan

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:

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.lock

Expected 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:

image
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions