ci: replace Travis environment variables with GitHub Action variables
This commit is contained in:
		
							parent
							
								
									a2266ca47d
								
							
						
					
					
						commit
						3da96bbb90
					
				| @ -31,12 +31,13 @@ const requireNoCache = proxyquire.noPreserveCache(); | |||||||
| // Environment variables used with semantic-release cli (similar to what a user would setup)
 | // Environment variables used with semantic-release cli (similar to what a user would setup)
 | ||||||
| const env = { | const env = { | ||||||
|   ...npmRegistry.authEnv, |   ...npmRegistry.authEnv, | ||||||
|  |   CI: 'true', | ||||||
|   GH_TOKEN: gitbox.gitCredential, |   GH_TOKEN: gitbox.gitCredential, | ||||||
|   GITHUB_URL: mockServer.url, |   GITHUB_URL: mockServer.url, | ||||||
|   TRAVIS: 'true', |   GITHUB_EVENT_NAME: 'push', | ||||||
|   CI: 'true', |   GITHUB_EVENT_PATH: null, | ||||||
|   TRAVIS_BRANCH: 'master', |   GITHUB_ACTION: null, | ||||||
|   TRAVIS_PULL_REQUEST: 'false', |   GITHUB_REF: 'master', | ||||||
| }; | }; | ||||||
| // Environment variables used only for the local npm command used to do verification
 | // Environment variables used only for the local npm command used to do verification
 | ||||||
| const testEnv = { | const testEnv = { | ||||||
| @ -233,7 +234,7 @@ test('Release patch, minor and major versions', async (t) => { | |||||||
|   await gitPush('origin', 'next', {cwd}); |   await gitPush('origin', 'next', {cwd}); | ||||||
|   await gitCommits(['feat: foo\n\n BREAKING CHANGE: bar'], {cwd}); |   await gitCommits(['feat: foo\n\n BREAKING CHANGE: bar'], {cwd}); | ||||||
|   t.log('$ semantic-release'); |   t.log('$ semantic-release'); | ||||||
|   ({stdout, exitCode} = await execa(cli, [], {env: {...env, TRAVIS_BRANCH: 'next'}, cwd})); |   ({stdout, exitCode} = await execa(cli, [], {env: {...env, GITHUB_REF: 'next'}, cwd})); | ||||||
|   t.regex(stdout, new RegExp(`Published GitHub release: release-url/${version}`)); |   t.regex(stdout, new RegExp(`Published GitHub release: release-url/${version}`)); | ||||||
|   t.regex(stdout, new RegExp(`Publishing version ${version} to npm registry`)); |   t.regex(stdout, new RegExp(`Publishing version ${version} to npm registry`)); | ||||||
|   t.is(exitCode, 0); |   t.is(exitCode, 0); | ||||||
| @ -400,7 +401,6 @@ test('Dry-run', async (t) => { | |||||||
| 
 | 
 | ||||||
| test('Allow local releases with "noCi" option', async (t) => { | test('Allow local releases with "noCi" option', async (t) => { | ||||||
|   const envNoCi = {...env}; |   const envNoCi = {...env}; | ||||||
|   delete envNoCi.TRAVIS; |  | ||||||
|   delete envNoCi.CI; |   delete envNoCi.CI; | ||||||
|   const packageName = 'test-no-ci'; |   const packageName = 'test-no-ci'; | ||||||
|   const owner = 'git'; |   const owner = 'git'; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user