Skip to content

Commit

Permalink
Add node-version input support
Browse files Browse the repository at this point in the history
  • Loading branch information
benpbolton committed Apr 26, 2024
1 parent 43fdb7b commit c42ec4a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
with:
plugin-file: 'plugin.php'
upgrade-npm-dependencies: "true"
node-version: '20' # Specify the Node.js version if not lts


```

Expand All @@ -48,9 +50,15 @@ repository to run `npm ci`.
- `plugin-file` - The name of the plugin's main file. Defaults to `plugin.php`.
- `upgrade-npm-dependencies` - Whether or not to run the `packages-update` npm
script. Defaults to `"true"`. Set to `"false"` to disable.
- `node-version` - The version of Node.js to use for running the action. Defaults to `"lts"`. Specify any version number or tag supported by actions/setup-node@v3 (e.g., `18`, `20`, `lts`, `latest`, etc.).


## Changelog

### 1.2.2

- Update action to allow node-version input (defaults to `lts`).

### 1.2.1

- Fix semvar comparsion logic.
Expand Down
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ inputs:
description: 'Upgrade the npm dependencies of the plugin to match WordPress'
default: "true"
required: false
node-version:
description: 'The version of Node.js to use'
default: "lts"
required: false
runs:
using: 'composite'
steps:
- id: setup-node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: ${{ inputs.node-version }}
- id: check-upgrade
env:
PLUGIN_FILE: ${{ inputs.plugin-file }}
Expand Down

0 comments on commit c42ec4a

Please sign in to comment.