From 5984462aaa1ebbfd6105de1f5d30f9c6b9b3ba77 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 8 Dec 2020 16:15:38 -0600 Subject: [PATCH] Rename node-arch to architecture --- README.md | 8 ++++---- __tests__/installer.test.ts | 2 +- action.yml | 2 +- dist/index.js | 6 +++--- src/main.ts | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a2a99c30..7d1bc7b3 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/__tests__/installer.test.ts b/__tests__/installer.test.ts index 6e39ad86..22ac3d68 100644 --- a/__tests__/installer.test.ts +++ b/__tests__/installer.test.ts @@ -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'; diff --git a/action.yml b/action.yml index 734f651f..4b524c45 100644 --- a/action.yml +++ b/action.yml @@ -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' diff --git a/dist/index.js b/dist/index.js index bd722687..4f786414 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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(); diff --git a/src/main.ts b/src/main.ts index 0d3eb77a..b0ae3de4 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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`' ); }