mirror of
				https://github.com/docker/setup-buildx-action.git
				synced 2025-11-01 03:45:47 +08:00 
			
		
		
		
	 4ba329ef89
			
		
	
	
		4ba329ef89
		
			
		
	
	
	
	
		
			
			If the action is configured to install buildx by default using the input then docker buildx sets up docker build as an alias for buildx making all docker build calls use the buildx builder instead of traditional builders. The action didn't perform cleanup in this case to uninstall the aliases which meant that any future workflows running on same GitHub Actions runner would get the buildx builders even if it did not explicitly request it. This commit tracks if the aliases were installed and removes them during post step of the action if so. Signed-off-by: Ashhar Hasan <hashhar_dev@outlook.com>
		
			
				
	
	
		
			48 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			48 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import * as core from '@actions/core';
 | |
| 
 | |
| export const IsDebug = !!process.env['STATE_isDebug'];
 | |
| export const standalone = /true/i.test(process.env['STATE_standalone'] || '');
 | |
| export const builderName = process.env['STATE_builderName'] || '';
 | |
| export const builderDriver = process.env['STATE_builderDriver'] || '';
 | |
| export const containerName = process.env['STATE_containerName'] || '';
 | |
| export const certsDir = process.env['STATE_certsDir'] || '';
 | |
| export const tmpDockerContext = process.env['STATE_tmpDockerContext'] || '';
 | |
| export const cleanup = /true/i.test(process.env['STATE_cleanup'] || '');
 | |
| export const buildxIsDefaultBuilder = /true/i.test(process.env['STATE_buildxIsDefaultBuilder'] || '');
 | |
| 
 | |
| export function setDebug(debug: string) {
 | |
|   core.saveState('isDebug', debug);
 | |
| }
 | |
| 
 | |
| export function setStandalone(standalone: boolean) {
 | |
|   core.saveState('standalone', standalone);
 | |
| }
 | |
| 
 | |
| export function setBuilderName(builderName: string) {
 | |
|   core.saveState('builderName', builderName);
 | |
| }
 | |
| 
 | |
| export function setBuilderDriver(builderDriver: string) {
 | |
|   core.saveState('builderDriver', builderDriver);
 | |
| }
 | |
| 
 | |
| export function setContainerName(containerName: string) {
 | |
|   core.saveState('containerName', containerName);
 | |
| }
 | |
| 
 | |
| export function setCertsDir(certsDir: string) {
 | |
|   core.saveState('certsDir', certsDir);
 | |
| }
 | |
| 
 | |
| export function setTmpDockerContext(tmpDockerContext: string) {
 | |
|   core.saveState('tmpDockerContext', tmpDockerContext);
 | |
| }
 | |
| 
 | |
| export function setCleanup(cleanup: boolean) {
 | |
|   core.saveState('cleanup', cleanup);
 | |
| }
 | |
| 
 | |
| export function setBuildxIsDefaultBuilder(buildxIsDefaultBuilder: boolean) {
 | |
|   core.saveState('buildxIsDefaultBuilder', buildxIsDefaultBuilder);
 | |
| }
 |