1
0
Fork 0
mirror of https://github.com/docker/setup-buildx-action.git synced 2025-05-10 08:29:30 +02:00

cleanup input to remove builder and temp files

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2023-03-03 11:56:21 +01:00
parent 03a7a3d9fb
commit 8b13d483f2
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
7 changed files with 84 additions and 24 deletions

View file

@ -16,8 +16,9 @@ actionsToolkit.run(
// main
async () => {
const inputs: context.Inputs = await context.getInputs();
const toolkit = new Toolkit();
stateHelper.setCleanup(inputs.cleanup);
const toolkit = new Toolkit();
const standalone = await toolkit.buildx.isStandalone();
stateHelper.setStandalone(standalone);
@ -164,9 +165,13 @@ actionsToolkit.run(
});
}
if (!stateHelper.cleanup) {
return;
}
if (stateHelper.builderName.length > 0) {
await core.group(`Removing builder`, async () => {
const buildx = new Buildx({standalone: /true/i.test(stateHelper.standalone)});
const buildx = new Buildx({standalone: stateHelper.standalone});
const rmCmd = await buildx.getCommand(['rm', stateHelper.builderName]);
await exec
.getExecOutput(rmCmd.command, rmCmd.args, {