Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
beeequeue committed Oct 7, 2022
1 parent 9a42594 commit d1f29d3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ inputs:
description: 'Set this option if you want the action to check for the latest available version that satisfies the version spec.'
default: 'false'
corepack:
description: 'Automatically enables corepack'
description: 'Enable corepack. Setting this to anything but `true` will pass the value to `corepack enable`.'
default: 'false'
registry-url:
description: 'Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file, and set up auth to read in from env.NODE_AUTH_TOKEN.'
Expand Down
21 changes: 18 additions & 3 deletions docs/advanced-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,9 @@ NOTE: As per https://github.com/actions/setup-node/issues/49 you cannot use `sec
### always-auth input
The always-auth input sets `always-auth=true` in .npmrc file. With this option set [npm](https://docs.npmjs.com/cli/v6/using-npm/config#always-auth)/yarn sends the authentication credentials when making a request to the registries.

## Automatically enable `corepack`
## Enable and/or configure `corepack`

_Requires Node >=14.19.0
_Requires Node >=14.19 or >=16.9_

`corepack` is a new experimental feature that automatically installs package managers as they are used. [Read more about it here](https://nodejs.org/docs/latest/api/corepack.html)

Expand All @@ -327,9 +327,24 @@ e.g.
```json
{
"name": "example",
"packageManager": "pnpm@7.9.5",
"packageManager": "pnpm@7.13.2",
// ...
}
```

Passing anything but `true` will pass the options to the `corepack enable` command:

```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '14.x'
corepack: npm
```

will call

```shell
corepack enable npm
```

0 comments on commit d1f29d3

Please sign in to comment.