mirror of
				https://code.forgejo.org/actions/checkout.git
				synced 2025-10-31 21:12:29 +00:00 
			
		
		
		
	
						commit
						02365495e9
					
				
					 4 changed files with 44 additions and 3 deletions
				
			
		|  | @ -1,5 +1,9 @@ | |||
| # Changelog | ||||
| 
 | ||||
| ## v4.2.2 | ||||
| * `url-helper.ts` now leverages well-known environment variables by @jww3 in https://github.com/actions/checkout/pull/1941 | ||||
| * Expand unit test coverage for `isGhes` by @jww3 in https://github.com/actions/checkout/pull/1946 | ||||
| 
 | ||||
| ## v4.2.1 | ||||
| * Check out other refs/* by commit if provided, fall back to ref by @orhantoy in https://github.com/actions/checkout/pull/1924 | ||||
| 
 | ||||
|  |  | |||
|  | @ -24,13 +24,50 @@ describe('getServerUrl tests', () => { | |||
| }) | ||||
| 
 | ||||
| describe('isGhes tests', () => { | ||||
|   const pristineEnv = process.env | ||||
| 
 | ||||
|   beforeEach(() => { | ||||
|     jest.resetModules() | ||||
|     process.env = {...pristineEnv} | ||||
|   }) | ||||
| 
 | ||||
|   afterAll(() => { | ||||
|     process.env = pristineEnv | ||||
|   }) | ||||
| 
 | ||||
|   it('basics', async () => { | ||||
|     delete process.env['GITHUB_SERVER_URL'] | ||||
|     expect(urlHelper.isGhes()).toBeFalsy() | ||||
|     expect(urlHelper.isGhes('https://github.com')).toBeFalsy() | ||||
|     expect(urlHelper.isGhes('https://contoso.ghe.com')).toBeFalsy() | ||||
|     expect(urlHelper.isGhes('https://test.github.localhost')).toBeFalsy() | ||||
|     expect(urlHelper.isGhes('https://src.onpremise.fabrikam.com')).toBeTruthy() | ||||
|   }) | ||||
| 
 | ||||
|   it('returns false when the GITHUB_SERVER_URL environment variable is not defined', async () => { | ||||
|     delete process.env['GITHUB_SERVER_URL'] | ||||
|     expect(urlHelper.isGhes()).toBeFalsy() | ||||
|   }) | ||||
| 
 | ||||
|   it('returns false when the GITHUB_SERVER_URL environment variable is set to github.com', async () => { | ||||
|     process.env['GITHUB_SERVER_URL'] = 'https://github.com' | ||||
|     expect(urlHelper.isGhes()).toBeFalsy() | ||||
|   }) | ||||
| 
 | ||||
|   it('returns false when the GITHUB_SERVER_URL environment variable is set to a GitHub Enterprise Cloud-style URL', async () => { | ||||
|     process.env['GITHUB_SERVER_URL'] = 'https://contoso.ghe.com' | ||||
|     expect(urlHelper.isGhes()).toBeFalsy() | ||||
|   }) | ||||
| 
 | ||||
|   it('returns false when the GITHUB_SERVER_URL environment variable has a .localhost suffix', async () => { | ||||
|     process.env['GITHUB_SERVER_URL'] = 'https://mock-github.localhost' | ||||
|     expect(urlHelper.isGhes()).toBeFalsy() | ||||
|   }) | ||||
| 
 | ||||
|   it('returns true when the GITHUB_SERVER_URL environment variable is set to some other URL', async () => { | ||||
|     process.env['GITHUB_SERVER_URL'] = 'https://src.onpremise.fabrikam.com' | ||||
|     expect(urlHelper.isGhes()).toBeTruthy() | ||||
|   }) | ||||
| }) | ||||
| 
 | ||||
| describe('getServerApiUrl tests', () => { | ||||
|  |  | |||
							
								
								
									
										4
									
								
								package-lock.json
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										4
									
								
								package-lock.json
									
										
									
										generated
									
									
									
								
							|  | @ -1,12 +1,12 @@ | |||
| { | ||||
|   "name": "checkout", | ||||
|   "version": "4.2.1", | ||||
|   "version": "4.2.2", | ||||
|   "lockfileVersion": 3, | ||||
|   "requires": true, | ||||
|   "packages": { | ||||
|     "": { | ||||
|       "name": "checkout", | ||||
|       "version": "4.2.1", | ||||
|       "version": "4.2.2", | ||||
|       "license": "MIT", | ||||
|       "dependencies": { | ||||
|         "@actions/core": "^1.10.1", | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| { | ||||
|   "name": "checkout", | ||||
|   "version": "4.2.1", | ||||
|   "version": "4.2.2", | ||||
|   "description": "checkout action", | ||||
|   "main": "lib/main.js", | ||||
|   "scripts": { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue