mirror of
https://github.com/docker/build-push-action.git
synced 2024-11-29 03:30:59 -05:00
Fix platforms extraction
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
4522dd93f5
commit
1886d9322f
2 changed files with 7 additions and 5 deletions
5
setup-qemu/dist/index.js
generated
vendored
5
setup-qemu/dist/index.js
generated
vendored
|
@ -1014,11 +1014,12 @@ function run() {
|
||||||
const image = core.getInput('image') || 'tonistiigi/binfmt:latest';
|
const image = core.getInput('image') || 'tonistiigi/binfmt:latest';
|
||||||
const platforms = core.getInput('platforms') || 'all';
|
const platforms = core.getInput('platforms') || 'all';
|
||||||
core.info(`💎 Installing QEMU static binaries...`);
|
core.info(`💎 Installing QEMU static binaries...`);
|
||||||
yield exec.exec(`docker`, ['run', '--rm', '--privileged', image, '--install', platforms], false).then(res => {
|
yield exec.exec('docker', ['run', '--rm', '--privileged', image, '--install', platforms], false);
|
||||||
|
core.info('🛒 Extracting available platforms...');
|
||||||
|
yield exec.exec(`docker`, ['run', '--rm', '--privileged', image], false).then(res => {
|
||||||
if (res.stderr != '' && !res.success) {
|
if (res.stderr != '' && !res.success) {
|
||||||
throw new Error(res.stderr);
|
throw new Error(res.stderr);
|
||||||
}
|
}
|
||||||
core.info('🛒 Extracting available platforms...');
|
|
||||||
const platforms = JSON.parse(res.stdout.trim());
|
const platforms = JSON.parse(res.stdout.trim());
|
||||||
core.setOutput('platforms', platforms.supported.join(','));
|
core.setOutput('platforms', platforms.supported.join(','));
|
||||||
});
|
});
|
||||||
|
|
|
@ -18,12 +18,13 @@ async function run(): Promise<void> {
|
||||||
const platforms: string = core.getInput('platforms') || 'all';
|
const platforms: string = core.getInput('platforms') || 'all';
|
||||||
|
|
||||||
core.info(`💎 Installing QEMU static binaries...`);
|
core.info(`💎 Installing QEMU static binaries...`);
|
||||||
await exec.exec(`docker`, ['run', '--rm', '--privileged', image, '--install', platforms], false).then(res => {
|
await exec.exec('docker', ['run', '--rm', '--privileged', image, '--install', platforms], false);
|
||||||
|
|
||||||
|
core.info('🛒 Extracting available platforms...');
|
||||||
|
await exec.exec(`docker`, ['run', '--rm', '--privileged', image], false).then(res => {
|
||||||
if (res.stderr != '' && !res.success) {
|
if (res.stderr != '' && !res.success) {
|
||||||
throw new Error(res.stderr);
|
throw new Error(res.stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
core.info('🛒 Extracting available platforms...');
|
|
||||||
const platforms: Platforms = JSON.parse(res.stdout.trim());
|
const platforms: Platforms = JSON.parse(res.stdout.trim());
|
||||||
core.setOutput('platforms', platforms.supported.join(','));
|
core.setOutput('platforms', platforms.supported.join(','));
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue