1
0
Fork 0
mirror of https://github.com/docker/setup-buildx-action.git synced 2025-06-28 00:06:42 +02:00

Support to retain cache

Signed-off-by: Balaji Arun <balajia@vt.edu>
This commit is contained in:
Balaji Arun 2023-02-23 13:11:05 -08:00 committed by CrazyMax
parent 3f1544eb9e
commit 4143b5899b
No known key found for this signature in database
GPG key ID: ADE44D8C9D44FBE4
6 changed files with 88 additions and 11 deletions

View file

@ -115,6 +115,7 @@ actionsToolkit.run(
});
}
}
stateHelper.setKeepState(inputs.keepState);
if (inputs.driver !== 'docker') {
await core.group(`Creating a new builder instance`, async () => {
@ -249,7 +250,7 @@ actionsToolkit.run(
const buildx = new Buildx({standalone: stateHelper.standalone});
const builder = new Builder({buildx: buildx});
if (await builder.exists(stateHelper.builderName)) {
const rmCmd = await buildx.getCommand(['rm', stateHelper.builderName]);
const rmCmd = await buildx.getCommand(['rm', stateHelper.builderName, ...(stateHelper.keepState ? ['--keep-state'] : [])]);
await Exec.getExecOutput(rmCmd.command, rmCmd.args, {
ignoreReturnCode: true
}).then(res => {