3
0
Fork 0
mirror of https://gitea.com/actions/setup-node.git synced 2024-11-24 11:09:33 +01:00

docs: add docs

This commit is contained in:
Sayak Mukhopadhyay 2022-12-26 23:00:06 +05:30
parent 41bb914692
commit 872987f82b
No known key found for this signature in database
GPG key ID: 89EEFF3FB23D3FFD
2 changed files with 30 additions and 0 deletions

View file

@ -138,6 +138,7 @@ If the runner is not able to access github.com, any Nodejs versions requested du
8. [Publishing to npmjs and GPR with npm](docs/advanced-usage.md#publish-to-npmjs-and-gpr-with-npm)
9. [Publishing to npmjs and GPR with yarn](docs/advanced-usage.md#publish-to-npmjs-and-gpr-with-yarn)
10. [Using private packages](docs/advanced-usage.md#use-private-packages)
11. [Enabling Corepack](docs/advanced-usage.md#enabling-corepack)
## License

View file

@ -358,3 +358,32 @@ 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.
## Enabling Corepack
You can enable [Corepack](https://github.com/nodejs/corepack) by using the `corepack` input. This will enable Corepack. You can then use `pnpm` and `yarn` commands in your project.
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16.x'
corepack: true
- name: Install dependencies
run: yarn install --immutable
```
You can also pass package manager names instead if you want to enable corepack for specific package managers only.
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16.x'
corepack: yarn pnpm
- name: Install dependencies
run: yarn install --immutable
```
This option by default is `false` as Corepack is still in experimental phase.