Skip to content

Commit

Permalink
src: only resolve buildref on success
Browse files Browse the repository at this point in the history
  • Loading branch information
adityamaru committed Dec 1, 2024
1 parent 99d48d0 commit 9841eab
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -738,10 +738,13 @@ actionsToolkit.run(
await core.group('Cleaning up Blacksmith builder', async () => {
if (builderInfo.addr) {
try {
const buildxHistory = new BuildxHistory();
const exportRes = await buildxHistory.export({
refs: ref ? [ref] : []
});
let exportRes;
if (!buildError) {
const buildxHistory = new BuildxHistory();
exportRes = await buildxHistory.export({
refs: ref ? [ref] : []
});
}
await shutdownBuildkitd();
core.info('Shutdown buildkitd');
for (let attempt = 1; attempt <= 3; attempt++) {
Expand Down Expand Up @@ -862,4 +865,4 @@ function buildSummaryEnabled(): boolean {
return Util.parseBool(process.env.DOCKER_BUILD_SUMMARY);
}
return true;
}
}

0 comments on commit 9841eab

Please sign in to comment.