Skip to content

Commit 551b42e

Browse files
authored
docs(README): fix cache_dependency_path type (#257)
* docs(README): fix `cache_dependency_path` type * docs(README): add multiple lockfile example * docs: update input description to match README
1 parent 739bfe4 commit 551b42e

2 files changed

Lines changed: 29 additions & 2 deletions

File tree

README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ If `run_install` is a YAML string representation of either an object or an array
4848

4949
### `cache_dependency_path`
5050

51-
**Optional** (_type:_ `string|string[]`, _default:_ `pnpm-lock.yaml`) File path to the pnpm lockfile, which contents hash will be used as a cache key.
51+
**Optional** (_type:_ `string`, _default:_ `pnpm-lock.yaml`) File path to the pnpm lockfile, whose contents hash will be used as a cache key. Accepts multiple paths delimited by newlines.
5252

5353
### `package_json_file`
5454

@@ -158,6 +158,33 @@ jobs:
158158

159159
**Note:** You don't need to run `pnpm store prune` at the end; post-action has already taken care of that.
160160

161+
### Cache dependencies from multiple lockfiles
162+
163+
```yaml
164+
on:
165+
- push
166+
- pull_request
167+
168+
jobs:
169+
cache-and-install-multiple:
170+
runs-on: ubuntu-latest
171+
172+
steps:
173+
- name: Checkout
174+
uses: actions/checkout@v6
175+
176+
- uses: pnpm/action-setup@v6
177+
with:
178+
version: 10
179+
cache: true
180+
cache_dependency_path: |
181+
one/pnpm-lock.yaml
182+
two/pnpm-lock.yaml
183+
run_install: |
184+
- cwd: one
185+
- cwd: two
186+
```
187+
161188
## Notes
162189

163190
This action does not setup Node.js for you, use [actions/setup-node](https://github.com/actions/setup-node) yourself.

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ inputs:
2020
required: false
2121
default: 'false'
2222
cache_dependency_path:
23-
description: File path to the pnpm lockfile, which contents hash will be used as a cache key
23+
description: File path to the pnpm lockfile, whose contents hash will be used as a cache key. Accepts multiple paths delimited by newlines.
2424
required: false
2525
default: 'pnpm-lock.yaml'
2626
package_json_file:

0 commit comments

Comments
 (0)