buildx(imagetools): add skip support and configurable create command silence

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2026-03-09 11:11:00 +01:00
parent 09c0f6a78e
commit d92ed04680
4 changed files with 48 additions and 3 deletions

View File

@@ -15,6 +15,8 @@
*/
import fs from 'fs';
import * as core from '@actions/core';
import {Buildx} from './buildx.js';
import {Context} from '../context.js';
import {Exec} from '../exec.js';
@@ -164,9 +166,15 @@ export class ImageTools {
}
const cmd = await this.getCreateCommand(args);
if (opts.skipExec) {
core.info(`[command]${cmd.command} ${cmd.args.join(' ')}`);
core.info(`Skipped create command`);
return undefined;
}
return await Exec.getExecOutput(cmd.command, cmd.args, {
ignoreReturnCode: true,
silent: true
silent: opts.silent
}).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
throw new Error(res.stderr.trim());

View File

@@ -33,6 +33,8 @@ export interface CreateOpts {
tags?: Array<string>;
platforms?: Array<string>;
dryRun?: boolean;
silent?: boolean;
skipExec?: boolean;
}
export interface CreateResponse {