mirror of
https://gh-proxy.com/https://github.com/docker/build-push-action
synced 2025-12-16 02:46:13 +08:00
Small refactor
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -50,21 +50,8 @@ async function run(): Promise<void> {
|
||||
await exec.exec('docker', ['buildx', 'install'], false);
|
||||
}
|
||||
|
||||
core.info('🐳 Docker info');
|
||||
await exec.exec('docker', ['info'], false);
|
||||
|
||||
core.info('🛒 Extracting available platforms...');
|
||||
await exec.exec(`docker`, ['buildx', 'inspect'], true).then(res => {
|
||||
if (res.stderr != '' && !res.success) {
|
||||
throw new Error(res.stderr);
|
||||
}
|
||||
for (const line of res.stdout.trim().split(os.EOL)) {
|
||||
if (line.startsWith('Platforms')) {
|
||||
core.setOutput('platforms', line.replace('Platforms: ', '').replace(/\s/g, '').trim());
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
core.setOutput('platforms', await buildx.platforms());
|
||||
} catch (error) {
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user