Skip to content

Commit 0e978b9

Browse files
committed
feat(github-actions): add cache-dependency-path to checkout-and-setup-node (#3023)
This allows specifying a dependency file path for more accurate caching, aligning with the official `setup-node` action's capabilities. The `ng-renovate` workflow is updated to use this new input. See: https://github.com/actions/setup-node?tab=readme-ov-file#caching-global-packages-data PR Close #3023
1 parent c68fb6a commit 0e978b9

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.github/workflows/ng-renovate.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
# this step.
3333
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3434
- uses: ./github-actions/npm/checkout-and-setup-node
35+
with:
36+
cache-dependency-path: './.github/ng-renovate/pnpm-lock.yaml'
3537
- run: pnpm install --frozen-lockfile
3638
working-directory: ./.github/ng-renovate
3739
- run: pnpm exec renovate

github-actions/npm/checkout-and-setup-node/action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ inputs:
2121
description: 'When set to true, disables the package manager cache.'
2222
default: false
2323

24+
cache-dependency-path:
25+
description: |
26+
Used to specify the path to a dependency file: package-lock.json, yarn.lock, etc.
27+
Supports wildcards or a list of file names for caching multiple dependencies.
28+
default: ''
29+
2430
runs:
2531
using: composite
2632
steps:
@@ -56,4 +62,5 @@ runs:
5662
with:
5763
node-version-file: ${{ inputs.node-version-file-path }}
5864
node-version: ${{ inputs.node-version }}
65+
cache-dependency-path: ${{ inputs.cache-dependency-path }}
5966
cache: ${{ inputs.disable-package-manager-cache != 'true' && steps.packageManager.outputs.CACHE_MANAGER_VALUE || '' }}

0 commit comments

Comments
 (0)