Skip to content

Commit 42d7977

Browse files
karlhorkyKSXGitHub
authored andcommittedSep 12, 2024
Add readme example for omitting version (pnpm#134)
* Add readme example for omitting `version` * docs: more detailed explanations --------- Co-authored-by: Khải <hvksmr1996@gmail.com>
1 parent 0d8d8e0 commit 42d7977

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed
 

‎README.md

+20-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ Location of `pnpm` and `pnpx` command.
6060

6161
## Usage example
6262

63-
### Just install pnpm
63+
### Install only pnpm without `packageManager`
64+
65+
This works when the repo either doesn't have a `package.json` or has a `package.json` but it doesn't specify `packageManager`.
6466

6567
```yaml
6668
on:
@@ -77,6 +79,23 @@ jobs:
7779
version: 8
7880
```
7981
82+
### Install only pnpm with `packageManager`
83+
84+
Omit `version` input to use the version in the [`packageManager` field in the `package.json`](https://nodejs.org/api/corepack.html).
85+
86+
```yaml
87+
on:
88+
- push
89+
- pull_request
90+
91+
jobs:
92+
install:
93+
runs-on: ubuntu-latest
94+
95+
steps:
96+
- uses: pnpm/action-setup@v4
97+
```
98+
8099
### Install pnpm and a few npm packages
81100

82101
```yaml

0 commit comments

Comments
 (0)
Please sign in to comment.