Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0dd3efc

Browse files
WomB0ComB0claude
andcommitted
feat(node-ci): forward cache-dependency-path to setup-node
Polyglot repos with a lockfile outside the repo root (e.g. viz's `src/ResQ.Viz.Web/package-lock.json`) couldn't adopt this reusable — actions/setup-node bailed with "Dependencies lock file is not found" because the reusable didn't accept a `cache-dependency-path` input. Changes: - node-ci.yml: add optional `cache-dependency-path` input, forward to the setup-node step. Default empty preserves current behaviour. - required.yml: add pass-through `node-cache-dependency-path` input so consumers routing through the org aggregator can set it. Surfaced during resq-software/viz PR #58 adoption attempt. Viz's client pipeline currently uses a hand-rolled inline job because of this gap — once this lands + the viz ref pin bumps, it can switch to the shared reusable. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
1 parent 109c36b commit 0dd3efc

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

.github/workflows/node-ci.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ on:
3131
type: string
3232
required: false
3333
default: "."
34+
cache-dependency-path:
35+
description: >-
36+
Forwarded to actions/setup-node's `cache-dependency-path`.
37+
Required when the lockfile lives outside the repo root
38+
(e.g. `src/Web/package-lock.json` in a polyglot repo).
39+
Default empty — setup-node falls back to repo-root detection,
40+
matching the prior behaviour for consumers that don't set it.
41+
type: string
42+
required: false
43+
default: ""
3444
install-cmd:
3545
description: Override install command. Empty = pm default.
3646
type: string
@@ -93,6 +103,7 @@ jobs:
93103
with:
94104
node-version: ${{ inputs.node-version }}
95105
cache: ${{ inputs.package-manager == 'yarn' && 'yarn' || inputs.package-manager == 'pnpm' && 'pnpm' || 'npm' }}
106+
cache-dependency-path: ${{ inputs.cache-dependency-path }}
96107

97108
- name: Install
98109
env:

.github/workflows/required.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ on:
5656
type: string
5757
required: false
5858
default: ""
59+
node-cache-dependency-path:
60+
description: >-
61+
Forwarded to node-ci.yml → actions/setup-node. Polyglot repos
62+
whose lockfile lives in a subdirectory (e.g. viz's
63+
`src/ResQ.Viz.Web/package-lock.json`) must set this, else
64+
setup-node errors with "Dependencies lock file is not found".
65+
Default empty = root-level detection (matches prior behaviour).
66+
type: string
67+
required: false
68+
default: ""
5969
rust-run-coverage:
6070
type: boolean
6171
required: false
@@ -165,6 +175,7 @@ jobs:
165175
typecheck-cmd: ${{ inputs.node-typecheck-cmd }}
166176
test-cmd: ${{ inputs.node-test-cmd }}
167177
build-cmd: ${{ inputs.node-build-cmd }}
178+
cache-dependency-path: ${{ inputs.node-cache-dependency-path }}
168179

169180
dotnet:
170181
needs: [validate-lang]

0 commit comments

Comments
 (0)