diff --git a/README.md b/README.md index 0431c57..aa32c1f 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,5 @@ * Reads node version file (.node-version) from project root * Only saves pnpm cache on the main branch * Restores pnpm cache on PR +* Skips `actions/setup-node` on Alpine Linux (which only ships glibc + binaries) and uses the container's musl Node instead. diff --git a/action.yml b/action.yml index 9b41c39..65c2e2f 100644 --- a/action.yml +++ b/action.yml @@ -24,9 +24,21 @@ inputs: runs: using: composite steps: + # actions/setup-node only ships glibc Node binaries; on Alpine those can't + # run, so use the container's musl Node instead. + - name: Detect Alpine Linux + id: detect + if: runner.os == 'Linux' + shell: bash + run: | + if [ -f /etc/alpine-release ]; then + echo "is-alpine=true" >> "$GITHUB_OUTPUT" + fi + - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 + if: steps.detect.outputs.is-alpine != 'true' with: node-version-file: .node-version architecture: ${{ inputs.architecture }}