Skip to content
Merged
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
14 changes: 13 additions & 1 deletion setup-env/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,23 @@ runs:
echo "Could not find existing node install, skipping node package installation"
fi

- name: Determine pnpm version
if: env.PACKAGE_MANAGER == 'pnpm'
shell: bash
run: |
if [ -e package.json ] && command -v jq >/dev/null; then
PNPM_VERSION=$(jq -r '.packageManager|split("@")[1]' package.json || echo "")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Splitting because the format in package.json is pnpm@version-num and we just need the version number.

fi
if [ -z "${PNPM_VERSION}" ]; then
PNPM_VERSION=latest
fi
echo "PNPM_VERSION=${PNPM_VERSION}" >>$GITHUB_ENV

- name: Install pnpm
if: env.PACKAGE_MANAGER == 'pnpm'
uses: pnpm/action-setup@v2
with:
version: latest
version: ${{ env.PNPM_VERSION }}

- name: Install Node dependencies
id: setup_node
Expand Down