diff --git a/.github/workflows/example-yarn-modern-pnp.yml b/.github/workflows/example-yarn-modern-pnp.yml index 993fb00dd..d73fa6066 100644 --- a/.github/workflows/example-yarn-modern-pnp.yml +++ b/.github/workflows/example-yarn-modern-pnp.yml @@ -12,13 +12,20 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - run: corepack enable yarn # experimental - see https://nodejs.org/docs/latest/api/corepack.html + - name: Enable Corepack # see https://yarnpkg.com/getting-started/install + run: | + npm install -g corepack + corepack enable yarn - name: Set up Yarn cache uses: actions/setup-node@v4 with: node-version-file: '.node-version' cache: yarn cache-dependency-path: examples/yarn-modern-pnp/yarn.lock + - name: Reinstall Corepack # actions/setup-node may have replaced Corepack with an older version + run: | + npm install -g corepack + corepack enable yarn - name: Custom Yarn command uses: ./ with: diff --git a/.github/workflows/example-yarn-modern.yml b/.github/workflows/example-yarn-modern.yml index 2a2c76779..558959943 100644 --- a/.github/workflows/example-yarn-modern.yml +++ b/.github/workflows/example-yarn-modern.yml @@ -12,13 +12,20 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - run: corepack enable yarn # experimental - see https://nodejs.org/docs/latest/api/corepack.html + - name: Enable Corepack # see https://yarnpkg.com/getting-started/install + run: | + npm install -g corepack + corepack enable yarn - name: Set up Yarn cache uses: actions/setup-node@v4 with: node-version-file: '.node-version' cache: yarn cache-dependency-path: examples/yarn-modern/yarn.lock + - name: Reinstall Corepack # actions/setup-node may have replaced Corepack with an older version + run: | + npm install -g corepack + corepack enable yarn - name: Custom Yarn command uses: ./ with: diff --git a/docs/MAINTENANCE.md b/docs/MAINTENANCE.md index 8b7e9b433..6ce117077 100644 --- a/docs/MAINTENANCE.md +++ b/docs/MAINTENANCE.md @@ -20,7 +20,7 @@ _The previous [examples/v9](https://github.com/cypress-io/github-action/tree/v5/ - [npm](https://www.npmjs.com/), which is installed with [Node.js](https://nodejs.org/). -- [corepack](https://github.com/nodejs/corepack), which is installed with [Node.js](https://nodejs.org/). +- [corepack](https://github.com/nodejs/corepack). This is currently installed with [Node.js](https://nodejs.org/). Due to plans of Node.js to remove it in versions Node.js `25.x` and later, you may need to install it separately with `npm install -g corepack`. - [pnpm](https://pnpm.io/) installed through: diff --git a/examples/yarn-modern-pnp/README.md b/examples/yarn-modern-pnp/README.md index 0891a2807..23adce6e2 100644 --- a/examples/yarn-modern-pnp/README.md +++ b/examples/yarn-modern-pnp/README.md @@ -5,6 +5,7 @@ This example demonstrates installing dependencies using [Yarn Modern v4](https:/ Run locally with: ```shell +npm install -g corepack corepack enable yarn yarn yarn test diff --git a/examples/yarn-modern/README.md b/examples/yarn-modern/README.md index bf41b0d67..8111780d2 100644 --- a/examples/yarn-modern/README.md +++ b/examples/yarn-modern/README.md @@ -5,6 +5,7 @@ This example demonstrates installing dependencies using [Yarn Modern v4](https:/ Run locally with: ```shell +npm install -g corepack corepack enable yarn yarn yarn test