From 872987f82bb21c42537c7263b72f8ed55efa13f9 Mon Sep 17 00:00:00 2001
From: Sayak Mukhopadhyay <mukhopadhyaysayak@gmail.com>
Date: Mon, 26 Dec 2022 23:00:06 +0530
Subject: [PATCH] docs: add docs

---
 README.md              |  1 +
 docs/advanced-usage.md | 29 +++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/README.md b/README.md
index 072da659..272dc04e 100644
--- a/README.md
+++ b/README.md
@@ -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
 
diff --git a/docs/advanced-usage.md b/docs/advanced-usage.md
index 4789f2ea..27c7a8af 100644
--- a/docs/advanced-usage.md
+++ b/docs/advanced-usage.md
@@ -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.