mirror of
				https://github.com/actions/checkout.git
				synced 2025-10-31 16:13:36 +00:00 
			
		
		
		
	Merge 183b9f399c93e6370f254dcceec017e3fa59f654 into cd7d8d697e10461458bc61a30d094dc601a8b017
This commit is contained in:
		
						commit
						26d5791cd7
					
				
							
								
								
									
										6
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							| @ -2400,14 +2400,16 @@ function getFetchUrl(settings) { | ||||
|     const encodedOwner = encodeURIComponent(settings.repositoryOwner); | ||||
|     const encodedName = encodeURIComponent(settings.repositoryName); | ||||
|     if (settings.sshKey) { | ||||
|         return `git@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`; | ||||
|         return serviceUrl.port === '' | ||||
|             ? `git@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git` | ||||
|             : `ssh://git@${serviceUrl.hostname}:${serviceUrl.port}/${encodedOwner}/${encodedName}.git`; | ||||
|     } | ||||
|     // "origin" is SCHEME://HOSTNAME[:PORT]
 | ||||
|     return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`; | ||||
| } | ||||
| exports.getFetchUrl = getFetchUrl; | ||||
| function getServerUrl(url) { | ||||
|     let urlValue = url && url.trim().length > 0 | ||||
|     const urlValue = url && url.trim().length > 0 | ||||
|         ? url | ||||
|         : process.env['GITHUB_SERVER_URL'] || 'https://github.com'; | ||||
|     return new url_1.URL(urlValue); | ||||
|  | ||||
| @ -1,6 +1,6 @@ | ||||
| import * as assert from 'assert' | ||||
| import {URL} from 'url' | ||||
| import {IGitSourceSettings} from './git-source-settings' | ||||
| import {URL} from 'url' | ||||
| 
 | ||||
| export function getFetchUrl(settings: IGitSourceSettings): string { | ||||
|   assert.ok( | ||||
| @ -11,8 +11,11 @@ export function getFetchUrl(settings: IGitSourceSettings): string { | ||||
|   const serviceUrl = getServerUrl(settings.githubServerUrl) | ||||
|   const encodedOwner = encodeURIComponent(settings.repositoryOwner) | ||||
|   const encodedName = encodeURIComponent(settings.repositoryName) | ||||
| 
 | ||||
|   if (settings.sshKey) { | ||||
|     return `git@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git` | ||||
|     return serviceUrl.port === '' | ||||
|       ? `git@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git` | ||||
|       : `ssh://git@${serviceUrl.hostname}:${serviceUrl.port}/${encodedOwner}/${encodedName}.git` | ||||
|   } | ||||
| 
 | ||||
|   // "origin" is SCHEME://HOSTNAME[:PORT]
 | ||||
| @ -20,7 +23,7 @@ export function getFetchUrl(settings: IGitSourceSettings): string { | ||||
| } | ||||
| 
 | ||||
| export function getServerUrl(url?: string): URL { | ||||
|   let urlValue = | ||||
|   const urlValue = | ||||
|     url && url.trim().length > 0 | ||||
|       ? url | ||||
|       : process.env['GITHUB_SERVER_URL'] || 'https://github.com' | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user