mirror of
				https://kkgithub.com/actions/setup-python.git
				synced 2025-11-04 04:31:51 +08:00 
			
		
		
		
	Revise isGhes logic (#963)
				
					
				
			* Revise `isGhes` logic * ran `npm run format` * add unit test * ran `npm run format`
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							19dfb7b659
						
					
				
				
					commit
					f4c5a1183d
				
			
							
								
								
									
										6
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							@ -92017,7 +92017,11 @@ function validatePythonVersionFormatForPyPy(version) {
 | 
			
		||||
exports.validatePythonVersionFormatForPyPy = validatePythonVersionFormatForPyPy;
 | 
			
		||||
function isGhes() {
 | 
			
		||||
    const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
 | 
			
		||||
    return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
 | 
			
		||||
    const hostname = ghUrl.hostname.trimEnd().toUpperCase();
 | 
			
		||||
    const isGitHubHost = hostname === 'GITHUB.COM';
 | 
			
		||||
    const isGitHubEnterpriseCloudHost = hostname.endsWith('.GHE.COM');
 | 
			
		||||
    const isLocalHost = hostname.endsWith('.LOCALHOST');
 | 
			
		||||
    return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost;
 | 
			
		||||
}
 | 
			
		||||
exports.isGhes = isGhes;
 | 
			
		||||
function isCacheFeatureAvailable() {
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user