Skip to content
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

Change default node-version-file to package.json #6

Merged
merged 6 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
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
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@ Allows changing the `node-version` passed to `actions/setup-node`.
node-version: 18
```

### `node-version-file`

Allows changing the `node-version-file` passed to `actions/setup-node`.

The default has changed from `actions/setup-node`'s `''` to `'package.json'`, enabling easy volta usage with 0 configuration for consumers of `wyvox/action-setup-pnpm`.
_not_ providing a volta config also have 0 consequence.

```yaml
- uses: wyvox/action-setup-pnpm@v3
with:
node-version-file: '.node-version'
```

### `node-registry-url`

Allows changing the `registry-url` passed to `actions/setup-node`.
Expand Down Expand Up @@ -82,7 +95,7 @@ steps:
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
cache: 'pnpm'
- run: pnpm install
Expand Down
9 changes: 8 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ inputs:
node-version:
description: "Override the default node version, or override what is specified in your project's volta config"
required: false
node-version-file:
description: "Override where the default node version is read from. By default this reads from package.json, which includes support for volta.node. Specifying node-version will override this"
required: false
default: 'package.json'
node-registry-url:
description: "Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file, and set up auth to read in from env.NODE_AUTH_TOKEN."
required: false
Expand Down Expand Up @@ -118,10 +122,13 @@ runs:
# Note also that volta's action does not have formal support for pnpm, nor its cache.
# - does not install pnpm
- name: 'Setup node and the cache for pnpm'
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
cache: 'pnpm'
# If specified, takes precedence over node-version-file
node-version: ${{ inputs.node-version }}
# Default node version read from package.json, but can be changed by passing in inputs.node-version-file
node-version-file: ${{ inputs.node-version-file }}
registry-url: ${{ inputs.node-registry-url }}

# It's only efficient to install dependencies
Expand Down
Loading