diff --git a/.github/workflows/setup-node-environment.yml b/.github/workflows/setup-node-environment.yml index 4605645..e6cf8fe 100644 --- a/.github/workflows/setup-node-environment.yml +++ b/.github/workflows/setup-node-environment.yml @@ -43,11 +43,6 @@ jobs: sed -i '/use-node-version/d' .npmrc node -v; - set -x; - nodeVersion=$(grep 'use-node-version=' .npmrc | sed -E 's/^use-node-version=([0-9.]+).*/\1/') - echo "node-version=$nodeVersion" >> $GITHUB_OUTPUT - sed -i '/use-node-version/d' .npmrc - - uses: yanhao98/composite-actions/setup-node-environment@main - name: Check Node and PNPM versions diff --git a/setup-node-environment/action.yml b/setup-node-environment/action.yml index 72b7565..d8cb431 100644 --- a/setup-node-environment/action.yml +++ b/setup-node-environment/action.yml @@ -69,6 +69,9 @@ runs: # Extract the node version from the .npmrc file set -x; nodeVersion=$(grep 'use-node-version=' .npmrc | sed -E 's/^use-node-version=([0-9.]+).*/\1/') + if [ -z "$nodeVersion" ]; then + nodeVersion="lts/*" + fi echo "node-version=$nodeVersion" >> $GITHUB_OUTPUT sed -i '/use-node-version/d' .npmrc @@ -76,7 +79,7 @@ runs: if: steps.prepare.outputs.setup-pnpm == 'true' - uses: actions/setup-node@v4 # https://github.com/actions/setup-node?tab=readme-ov-file#usage with: - node-version: ${{ steps.prepare.outputs.node-version || 'lts/*' }} + node-version: ${{ steps.prepare.outputs.node-version }} cache: ${{ steps.prepare.outputs.cache }} - name: 📦 Install Project Dependencies if: steps.prepare.outputs.pnpm-lock-exists == 'true'