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
This commit is contained in:
Andrew Haines
2026-05-11 15:41:41 +01:00
committed by GitHub
parent 739bfe42ca
commit 551b42e879
2 changed files with 29 additions and 2 deletions

View File

@@ -48,7 +48,7 @@ If `run_install` is a YAML string representation of either an object or an array
### `cache_dependency_path`
**Optional** (_type:_ `string|string[]`, _default:_ `pnpm-lock.yaml`) File path to the pnpm lockfile, which contents hash will be used as a cache key.
**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.
### `package_json_file`
@@ -158,6 +158,33 @@ jobs:
**Note:** You don't need to run `pnpm store prune` at the end; post-action has already taken care of that.
### Cache dependencies from multiple lockfiles
```yaml
on:
- push
- pull_request
jobs:
cache-and-install-multiple:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
with:
version: 10
cache: true
cache_dependency_path: |
one/pnpm-lock.yaml
two/pnpm-lock.yaml
run_install: |
- cwd: one
- cwd: two
```
## Notes
This action does not setup Node.js for you, use [actions/setup-node](https://github.com/actions/setup-node) yourself.

View File

@@ -20,7 +20,7 @@ inputs:
required: false
default: 'false'
cache_dependency_path:
description: File path to the pnpm lockfile, which contents hash will be used as a cache key
description: File path to the pnpm lockfile, whose contents hash will be used as a cache key. Accepts multiple paths delimited by newlines.
required: false
default: 'pnpm-lock.yaml'
package_json_file: