mirror of
				https://github.com/actions/setup-node.git
				synced 2025-11-04 01:03:33 +00:00 
			
		
		
		
	syncing with main
This commit is contained in:
		
							parent
							
								
									36bb47b5a0
								
							
						
					
					
						commit
						34ece939a3
					
				
							
								
								
									
										26
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										26
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							@ -6868,18 +6868,7 @@ 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...
 | 
			
		||||
            //
 | 
			
		||||
            let version = core.getInput('node-version');
 | 
			
		||||
            if (!version) {
 | 
			
		||||
                version = core.getInput('version');
 | 
			
		||||
                if (!version) {
 | 
			
		||||
                    const versionFile = core.getInput('node-version-file');
 | 
			
		||||
                    if (!!versionFile) {
 | 
			
		||||
                        const versionFilePath = path.join(process.env.GITHUB_WORKSPACE, versionFile);
 | 
			
		||||
                        version = installer.parseNodeVersionFile(fs_1.default.readFileSync(versionFilePath, 'utf8'));
 | 
			
		||||
                        core.info(`Resolved ${versionFile} as ${version}`);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            let version = resolveVersionInput();
 | 
			
		||||
            let arch = core.getInput('architecture');
 | 
			
		||||
            const cache = core.getInput('cache');
 | 
			
		||||
            // if architecture supplied but node-version is not
 | 
			
		||||
@ -6924,6 +6913,19 @@ function isGhes() {
 | 
			
		||||
    const ghUrl = new url_1.URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
 | 
			
		||||
    return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
 | 
			
		||||
}
 | 
			
		||||
function resolveVersionInput() {
 | 
			
		||||
    let version = core.getInput('node-version') || core.getInput('version');
 | 
			
		||||
    if (version) {
 | 
			
		||||
        return version;
 | 
			
		||||
    }
 | 
			
		||||
    const versionFileInput = core.getInput('node-version-file');
 | 
			
		||||
    if (versionFileInput) {
 | 
			
		||||
        const versionFilePath = path.join(process.env.GITHUB_WORKSPACE, versionFileInput);
 | 
			
		||||
        version = installer.parseNodeVersionFile(fs_1.default.readFileSync(versionFilePath, 'utf8'));
 | 
			
		||||
        core.info(`Resolved ${versionFileInput} as ${version}`);
 | 
			
		||||
    }
 | 
			
		||||
    return version;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/***/ }),
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user