diff --git a/README.md b/README.md index 6a7540e..5bd5415 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/action.yml b/action.yml index fe97198..d2f1196 100644 --- a/action.yml +++ b/action.yml @@ -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: