From 08bc1bb9f66dc38546bc192aedd3f5162900e56e Mon Sep 17 00:00:00 2001 From: Karl Horky Date: Wed, 3 Jul 2024 11:39:50 +0200 Subject: [PATCH 1/2] Add readme example for omitting `version` --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index aff3cb7..24725de 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Location of `pnpm` and `pnpx` command. ## Usage example -### Just install pnpm +### Install only pnpm ```yaml on: @@ -77,6 +77,23 @@ jobs: version: 8 ``` +### Install only pnpm, use `packageManager` version + +Omit `version` input to use the version in the [`packageManager` field in the `package.json`](https://nodejs.org/api/corepack.html). + +```yaml +on: + - push + - pull_request + +jobs: + install: + runs-on: ubuntu-latest + + steps: + - uses: pnpm/action-setup@v4 +``` + ### Install pnpm and a few npm packages ```yaml From 78487e251b650717f162d635f46156cb72318743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kh=E1=BA=A3i?= Date: Wed, 3 Jul 2024 17:00:58 +0700 Subject: [PATCH 2/2] docs: more detailed explanations --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 24725de..d5d17eb 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,9 @@ Location of `pnpm` and `pnpx` command. ## Usage example -### Install only pnpm +### Install only pnpm without `packageManager` + +This works when the repo either doesn't have a `package.json` or has a `package.json` but it doesn't specify `packageManager`. ```yaml on: @@ -77,7 +79,7 @@ jobs: version: 8 ``` -### Install only pnpm, use `packageManager` version +### Install only pnpm with `packageManager` Omit `version` input to use the version in the [`packageManager` field in the `package.json`](https://nodejs.org/api/corepack.html).