name: 'Setup nodes'
description: 'Setup nodejs'

inputs:
  node-version:
    description: 'The version of node to use'
    required: true
    default: '20.17.0'
  pnpm-version:
    description: 'The version of pnpm to use'
    required: true
    default: '9.14.4'
  pnpm-install-options:
    description: 'The options to pass to pnpm install'
    required: true
    default: '--frozen-lockfile --prefer-offline --ignore-scripts'

runs:
  using: 'composite'
  steps:
    - uses: pnpm/action-setup@v4
      with:
        version: ${{ inputs.pnpm-version }}

    - uses: actions/setup-node@v4
      with:
        node-version: ${{ inputs.node-version }}
        cache: 'pnpm'

    - name: pnpm install
      run: pnpm i ${{ inputs.pnpm-install-options }}
      shell: bash
