Skip to content

Commit dd2e8a4

Browse files
author
Danny McCormick
authored
Use node-version instead of version (#28)
* Use node-version instead of version * Add deprecation date
1 parent d963e80 commit dd2e8a4

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ steps:
1919
- uses: actions/checkout@master
2020
- uses: actions/setup-node@v1
2121
with:
22-
version: '10.x'
22+
node-version: '10.x'
2323
- run: npm install
2424
- run: npm test
2525
```
@@ -38,7 +38,7 @@ jobs:
3838
- name: Setup node
3939
uses: actions/setup-node@v1
4040
with:
41-
version: ${{ matrix.node }}
41+
node-version: ${{ matrix.node }}
4242
- run: npm install
4343
- run: npm test
4444
```
@@ -49,7 +49,7 @@ steps:
4949
- uses: actions/checkout@master
5050
- uses: actions/setup-node@v1
5151
with:
52-
version: '10.x'
52+
node-version: '10.x'
5353
registry-url: 'https://registry.npmjs.org'
5454
- run: npm install
5555
- run: npm publish
@@ -69,7 +69,7 @@ steps:
6969
- uses: actions/checkout@master
7070
- uses: actions/setup-node@v1
7171
with:
72-
version: '10.x'
72+
node-version: '10.x'
7373
registry-url: <registry url>
7474
- run: npm install -g yarn
7575
- run: yarn install

action.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
name: 'Setup Node.js environment'
22
description: 'Setup a Node.js environment and add it to the PATH, additionally providing proxy support'
33
author: 'GitHub'
4-
inputs:
5-
version:
6-
description: 'Version Spec of the version to use. Examples: 10.x, 10.15.1, >=10.15.0, lts'
4+
inputs:
5+
node-version:
6+
description: 'Version Spec of the version to use. Examples: 10.x, 10.15.1, >=10.15.0'
77
default: '10.x'
88
registry-url:
99
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'
1010
scope:
1111
description: 'Optional scope for authenticating against scoped registries'
12+
# Deprecated option, do not use. Will not be supported after October 1, 2019
13+
version:
14+
description: 'Deprecated. Use node-version instead. Will not be supported after October 1, 2019'
1215
runs:
1316
using: 'node12'
1417
main: 'lib/setup-node.js'

lib/setup-node.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ function run() {
2626
// Version is optional. If supplied, install / use from the tool cache
2727
// If not supplied then task is still used to setup proxy, auth, etc...
2828
//
29-
const version = core.getInput('version');
29+
let version = core.getInput('version');
30+
if (!version) {
31+
version = core.getInput('node-version');
32+
}
3033
if (version) {
3134
// TODO: installer doesn't support proxy
3235
yield installer.getNode(version);

src/setup-node.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ async function run() {
99
// Version is optional. If supplied, install / use from the tool cache
1010
// If not supplied then task is still used to setup proxy, auth, etc...
1111
//
12-
const version = core.getInput('version');
12+
let version = core.getInput('version');
13+
if (!version) {
14+
version = core.getInput('node-version');
15+
}
1316
if (version) {
1417
// TODO: installer doesn't support proxy
1518
await installer.getNode(version);

0 commit comments

Comments
 (0)