You've already forked setup-node
							
							
				mirror of
				https://github.com/actions/setup-node.git
				synced 2025-11-04 16:56:38 +07:00 
			
		
		
		
	feat: add arch to run
This commit is contained in:
		@ -3,6 +3,7 @@ import * as installer from './installer';
 | 
				
			|||||||
import * as auth from './authutil';
 | 
					import * as auth from './authutil';
 | 
				
			||||||
import * as path from 'path';
 | 
					import * as path from 'path';
 | 
				
			||||||
import {URL} from 'url';
 | 
					import {URL} from 'url';
 | 
				
			||||||
 | 
					import os = require('os');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export async function run() {
 | 
					export async function run() {
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
@ -15,13 +16,18 @@ export async function run() {
 | 
				
			|||||||
      version = core.getInput('version');
 | 
					      version = core.getInput('version');
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    let arch = core.getInput('node-arch');
 | 
				
			||||||
 | 
					    if (!arch) {
 | 
				
			||||||
 | 
					      arch = os.arch();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (version) {
 | 
					    if (version) {
 | 
				
			||||||
      let token = core.getInput('token');
 | 
					      let token = core.getInput('token');
 | 
				
			||||||
      let auth = !token || isGhes() ? undefined : `token ${token}`;
 | 
					      let auth = !token || isGhes() ? undefined : `token ${token}`;
 | 
				
			||||||
      let stable = (core.getInput('stable') || 'true').toUpperCase() === 'TRUE';
 | 
					      let stable = (core.getInput('stable') || 'true').toUpperCase() === 'TRUE';
 | 
				
			||||||
      const checkLatest =
 | 
					      const checkLatest =
 | 
				
			||||||
        (core.getInput('check-latest') || 'false').toUpperCase() === 'TRUE';
 | 
					        (core.getInput('check-latest') || 'false').toUpperCase() === 'TRUE';
 | 
				
			||||||
      await installer.getNode(version, stable, checkLatest, auth);
 | 
					      await installer.getNode(version, stable, checkLatest, auth, arch);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const registryUrl: string = core.getInput('registry-url');
 | 
					    const registryUrl: string = core.getInput('registry-url');
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user