Skip to content

Commit

Permalink
Rename node-arch to architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Dec 8, 2020
1 parent aabe026 commit 5984462
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,21 @@ jobs:
- 10
- 12
- 14
node_arch:
architecture:
- x64
# an extra windows-x86 run:
include:
- os: windows-2016
node_version: 12
node_arch: x86
name: Node ${{ matrix.node_version }} - ${{ matrix.node_arch }} on ${{ matrix.os }}
architecture: x86
name: Node ${{ matrix.node_version }} - ${{ matrix.architecture }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node_version }}
node-arch: ${{ matrix.node_arch }}
architecture: ${{ matrix.architecture }}
- run: npm install
- run: npm test
```
Expand Down
2 changes: 1 addition & 1 deletion __tests__/installer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ describe('setup-node', () => {
}[os.platform];

inputs['node-version'] = version;
inputs['node-arch'] = arch;
inputs['architecture'] = arch;
inputs['always-auth'] = false;
inputs['token'] = 'faketoken';

Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ inputs:
default: 'false'
node-version:
description: 'Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0'
node-arch:
architecture:
description: 'Target architecture for Node to use. Examples: x86, x64. Will use system architecture by default.'
check-latest:
description: 'Set this option if you want the action to check for the latest available version that satisfies the version spec'
Expand Down
6 changes: 3 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4706,11 +4706,11 @@ function run() {
if (!version) {
version = core.getInput('version');
}
let arch = core.getInput('node-arch');
// if node-arch supplied but node-version is not
let arch = core.getInput('architecture');
// if architecture supplied but node-version is not
// if we don't throw a warning, the already installed x64 node will be used which is not probably what user meant.
if (arch && !version) {
core.warning('`node-arch` is provided but `node-version` is missing. This results in using an already installed x64 node which is not probably what you meant. To fix this, provide `node-arch` in combination with `node-version`');
core.warning('`architecture` is provided but `node-version` is missing. This results in using an already installed x64 node which is not probably what you meant. To fix this, provide `architecture` in combination with `node-version`');
}
if (!arch) {
arch = os.arch();
Expand Down
6 changes: 3 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ export async function run() {
version = core.getInput('version');
}

let arch = core.getInput('node-arch');
let arch = core.getInput('architecture');

// if node-arch supplied but node-version is not
// if architecture supplied but node-version is not
// if we don't throw a warning, the already installed x64 node will be used which is not probably what user meant.
if (arch && !version) {
core.warning(
'`node-arch` is provided but `node-version` is missing. This results in using an already installed x64 node which is not probably what you meant. To fix this, provide `node-arch` in combination with `node-version`'
'`architecture` is provided but `node-version` is missing. This results in using an already installed x64 node which is not probably what you meant. To fix this, provide `architecture` in combination with `node-version`'
);
}

Expand Down

0 comments on commit 5984462

Please sign in to comment.