Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to enable corepack #651

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: add docs
  • Loading branch information
SayakMukhopadhyay committed Dec 26, 2022
commit 872987f82bb21c42537c7263b72f8ed55efa13f9
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

29 changes: 29 additions & 0 deletions docs/advanced-usage.md
Original file line number Diff line number Diff line change
@@ -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.