Skip to content

Commit

Permalink
Add readme example for omitting version (#134)
Browse files Browse the repository at this point in the history
* Add readme example for omitting `version`

* docs: more detailed explanations

---------

Co-authored-by: Khải <hvksmr1996@gmail.com>
  • Loading branch information
karlhorky and KSXGitHub authored Jul 4, 2024
1 parent 23657c8 commit 0eb0e97
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ Location of `pnpm` and `pnpx` command.

## 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
on:
Expand All @@ -77,6 +79,23 @@ jobs:
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

```yaml
Expand Down

0 comments on commit 0eb0e97

Please sign in to comment.