From 032246240fa3b388983a62c70665030282bb211c Mon Sep 17 00:00:00 2001 From: Adam Iskounen Date: Thu, 25 Jun 2026 16:24:00 -0400 Subject: [PATCH 1/3] fix: use npx to invoke correct Yarn version instead of relying on Corepack PATH shims Co-Authored-By: Claude Sonnet 4.6 --- .github/actions/setup-and-install/action.yml | 32 +++++++++----------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/.github/actions/setup-and-install/action.yml b/.github/actions/setup-and-install/action.yml index 653109d..71166bc 100644 --- a/.github/actions/setup-and-install/action.yml +++ b/.github/actions/setup-and-install/action.yml @@ -17,10 +17,6 @@ runs: with: node-version: ${{ inputs.node-version }} - - name: Enable Corepack - shell: bash - run: corepack enable - - name: Cache Yarn packages uses: actions/cache@v4 with: @@ -42,21 +38,23 @@ runs: echo "Installing packages in: $INSTALL_DIR" cd "$INSTALL_DIR" - # Activate the packageManager version via corepack so the global Yarn isn't used instead of the project's version + # Detect the Yarn version from the packageManager field and install with appropriate flags. + # For Yarn 1, npx is used to invoke the exact version rather than the global Yarn binary. PKG_MANAGER=$(node -e "try{process.stdout.write(require('./package.json').packageManager||'')}catch(e){}" 2>/dev/null || echo "") - if [[ -n "$PKG_MANAGER" && "$PKG_MANAGER" =~ ^yarn@ ]]; then - echo "Activating $PKG_MANAGER via corepack" - corepack prepare "$PKG_MANAGER" --activate - fi - # Detect Yarn version and install with appropriate flags - YARN_VERSION=$(yarn --version) - if [[ "$YARN_VERSION" =~ ^[234] ]]; then - # Yarn 2+ (Berry) - echo "Detected Yarn $YARN_VERSION (Berry)" + if [[ "$PKG_MANAGER" =~ ^yarn@1 ]]; then + echo "Detected Yarn 1 (Classic)" + npx --yes "$PKG_MANAGER" install --frozen-lockfile + elif [[ -n "$PKG_MANAGER" && "$PKG_MANAGER" =~ ^yarn@ ]]; then + echo "Detected Yarn (Berry)" yarn install --no-immutable else - # Yarn 1 (Classic) - echo "Detected Yarn $YARN_VERSION (Classic)" - yarn install --frozen-lockfile + YARN_VERSION=$(yarn --version) + if [[ "$YARN_VERSION" =~ ^[234] ]]; then + echo "Detected Yarn $YARN_VERSION (Berry)" + yarn install --no-immutable + else + echo "Detected Yarn $YARN_VERSION (Classic)" + yarn install --frozen-lockfile + fi fi From 6f66316feac8c5d47530faeb1bb411e99826367b Mon Sep 17 00:00:00 2001 From: Adam Iskounen Date: Thu, 25 Jun 2026 16:30:37 -0400 Subject: [PATCH 2/3] fix: strip integrity hash from packageManager before passing to npx Co-Authored-By: Claude Sonnet 4.6 --- .github/actions/setup-and-install/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-and-install/action.yml b/.github/actions/setup-and-install/action.yml index 71166bc..ccd1d12 100644 --- a/.github/actions/setup-and-install/action.yml +++ b/.github/actions/setup-and-install/action.yml @@ -44,7 +44,7 @@ runs: if [[ "$PKG_MANAGER" =~ ^yarn@1 ]]; then echo "Detected Yarn 1 (Classic)" - npx --yes "$PKG_MANAGER" install --frozen-lockfile + npx --yes "${PKG_MANAGER%%+*}" install --frozen-lockfile elif [[ -n "$PKG_MANAGER" && "$PKG_MANAGER" =~ ^yarn@ ]]; then echo "Detected Yarn (Berry)" yarn install --no-immutable From 165d78655e701022b97ee777df5f17fa78e90c17 Mon Sep 17 00:00:00 2001 From: Adam Iskounen Date: Thu, 25 Jun 2026 16:36:57 -0400 Subject: [PATCH 3/3] fix: tighten Yarn 1 classifier to ^yarn@1\. to avoid matching yarn@10+ Co-Authored-By: Claude Sonnet 4.6 --- .github/actions/setup-and-install/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-and-install/action.yml b/.github/actions/setup-and-install/action.yml index ccd1d12..6f81125 100644 --- a/.github/actions/setup-and-install/action.yml +++ b/.github/actions/setup-and-install/action.yml @@ -42,7 +42,7 @@ runs: # For Yarn 1, npx is used to invoke the exact version rather than the global Yarn binary. PKG_MANAGER=$(node -e "try{process.stdout.write(require('./package.json').packageManager||'')}catch(e){}" 2>/dev/null || echo "") - if [[ "$PKG_MANAGER" =~ ^yarn@1 ]]; then + if [[ "$PKG_MANAGER" =~ ^yarn@1\. ]]; then echo "Detected Yarn 1 (Classic)" npx --yes "${PKG_MANAGER%%+*}" install --frozen-lockfile elif [[ -n "$PKG_MANAGER" && "$PKG_MANAGER" =~ ^yarn@ ]]; then