Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
16 changes: 16 additions & 0 deletions .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,22 @@ runs:
with:
node-version: ${{ inputs.node-version }}

# Node 25 and later no longer ship Corepack. Install it next to the active
# Node when it is missing there. Checking `command -v corepack` is not
# enough: on GitHub's runner images a Corepack from the image's own Node
# stays on PATH, which hides the problem until a job runs in a container
# without one. Node 24 and earlier keep their bundled Corepack untouched.
- name: Install Corepack if Node lacks it
shell: bash
env:
COREPACK_VERSION: '0.36.0'
run: |
node_bin="$(dirname "$(command -v node)")"
if [ ! -x "$node_bin/corepack" ]; then
echo "Node $(node --version) has no Corepack; installing corepack@$COREPACK_VERSION."
npm install --global "corepack@$COREPACK_VERSION"
fi

- name: Enable Corepack for Yarn 4
shell: bash
run: corepack enable
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,14 @@ and would either fail or silently cache Yarn 1's directory for a Yarn 4 repo.
The `yarn-cache` input resolves the folder with `yarn config get cacheFolder`
after Corepack instead.

**Node 25 and later do not ship Corepack.** When the active Node has no
`corepack` in its bin directory, the action installs a pinned `corepack` there
with `npm install --global` before enabling it. It checks the bin directory
rather than `PATH` because GitHub's runner images leave a Corepack from their
own Node on `PATH`; a job that runs in a container, such as the Playwright
image, has no such leftover and would fail with `corepack: command not found`.
Node 24 and earlier use their bundled Corepack, as before.

This replaced identical local copies in `truenas/webui` and `truenas-connect/ui`
and six inline repetitions in `iXsystems/truenas-ui-components`'s `ci-cd.yml`,
which had drifted to a floating `'24'` against the others' pinned `24.13.1`.
Expand Down
Loading