Skip to content

fix(action.yml): use .nvmrc, package.json in action repo #165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 12, 2023
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: 12 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,22 @@ inputs:
runs:
using: composite
steps:
# Both pnpm and setup-node expect paths relative to checked-out repo. But we
# want to use package.json and .nvmrc from action repo. So, we'll provide
# them a path relative to GITHUB_WORKSPACE
# See https://github.com/actions/setup-node/issues/852
- id: action_relative_path
run: |
action_path=$(node -p 'require("path").relative(process.env.GITHUB_WORKSPACE, "${{ github.action_path }}")')
echo "action_path=${action_path}" >> "$GITHUB_OUTPUT"
shell: bash

- uses: pnpm/action-setup@v2
with:
version: 7
package_json_file: ${{ steps.action_relative_path.outputs.action_path }}/package.json
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
node-version-file: ${{ steps.action_relative_path.outputs.action_path }}/.nvmrc
- name: Set up action
run: |
echo "::group::Set up action"
Expand Down