mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-20 05:14:44 +00:00
Added option to enable corepack (#1)
Co-authored-by: Steven <steven@ceriously.com> Co-authored-by: Sayak Mukhopadhyay <mukhopadhyaysayak@gmail.com> Co-authored-by: Jacob Parish <jacob.parish.1@gmail.com>
This commit is contained in:
parent
5ef044f9d0
commit
2936fe8cda
8 changed files with 132 additions and 15 deletions
|
@ -416,3 +416,32 @@ Please refer to the [Ensuring workflow access to your package - Configuring a pa
|
|||
|
||||
### 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. 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 separated by a space 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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue