mirror of
https://github.com/pnpm/action-setup.git
synced 2024-11-10 09:39:11 +08:00
Add readme example for omitting version
(#134)
* Add readme example for omitting `version` * docs: more detailed explanations --------- Co-authored-by: Khải <hvksmr1996@gmail.com>
This commit is contained in:
parent
23657c8550
commit
0eb0e97082
21
README.md
21
README.md
@ -60,7 +60,9 @@ Location of `pnpm` and `pnpx` command.
|
|||||||
|
|
||||||
## Usage example
|
## Usage example
|
||||||
|
|
||||||
### Just install 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
|
```yaml
|
||||||
on:
|
on:
|
||||||
@ -77,6 +79,23 @@ jobs:
|
|||||||
version: 8
|
version: 8
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 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).
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
on:
|
||||||
|
- push
|
||||||
|
- pull_request
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
install:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: pnpm/action-setup@v4
|
||||||
|
```
|
||||||
|
|
||||||
### Install pnpm and a few npm packages
|
### Install pnpm and a few npm packages
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
Loading…
Reference in New Issue
Block a user