Skip to content

Use node-version instead of version #28

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 2 commits into from
Aug 13, 2019
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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v1
with:
version: '10.x'
node-version: '10.x'
- run: npm install
- run: npm test
```
Expand All @@ -38,7 +38,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v1
with:
version: ${{ matrix.node }}
node-version: ${{ matrix.node }}
- run: npm install
- run: npm test
```
Expand All @@ -49,7 +49,7 @@ steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v1
with:
version: '10.x'
node-version: '10.x'
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm publish
Expand All @@ -69,7 +69,7 @@ steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v1
with:
version: '10.x'
node-version: '10.x'
registry-url: <registry url>
- run: npm install -g yarn
- run: yarn install
Expand Down
9 changes: 6 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
name: 'Setup Node.js environment'
description: 'Setup a Node.js environment and add it to the PATH, additionally providing proxy support'
author: 'GitHub'
inputs:
version:
description: 'Version Spec of the version to use. Examples: 10.x, 10.15.1, >=10.15.0, lts'
inputs:
node-version:
description: 'Version Spec of the version to use. Examples: 10.x, 10.15.1, >=10.15.0'
default: '10.x'
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'
scope:
description: 'Optional scope for authenticating against scoped registries'
# Deprecated option, do not use. Will not be supported after October 1, 2019
version:
description: 'Deprecated. Use node-version instead. Will not be supported after October 1, 2019'
runs:
using: 'node12'
main: 'lib/setup-node.js'
5 changes: 4 additions & 1 deletion lib/setup-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ function run() {
// Version is optional. If supplied, install / use from the tool cache
// If not supplied then task is still used to setup proxy, auth, etc...
//
const version = core.getInput('version');
let version = core.getInput('version');
if (!version) {
version = core.getInput('node-version');
}
if (version) {
// TODO: installer doesn't support proxy
yield installer.getNode(version);
Expand Down
5 changes: 4 additions & 1 deletion src/setup-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ async function run() {
// Version is optional. If supplied, install / use from the tool cache
// If not supplied then task is still used to setup proxy, auth, etc...
//
const version = core.getInput('version');
let version = core.getInput('version');
if (!version) {
version = core.getInput('node-version');
}
if (version) {
// TODO: installer doesn't support proxy
await installer.getNode(version);
Expand Down