Skip to content

Commit

Permalink
don't generate summary for cloud driver
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max committed Jun 14, 2024
1 parent 00f0c17 commit 93d1f86
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ actionsToolkit.run(
await core.group(`Builder info`, async () => {
const builder = await toolkit.builder.inspect(inputs.builder);
core.info(JSON.stringify(builder, null, 2));
stateHelper.setBuilder(builder);
});

let definition: BakeDefinition | undefined;
Expand Down Expand Up @@ -170,6 +171,10 @@ actionsToolkit.run(
core.info('Summary disabled');
return;
}
if (stateHelper.builder && stateHelper.builder.driver === 'cloud') {
core.info('Summary is not yet supported with Docker Build Cloud');
return;
}
try {
const buildxHistory = new BuildxHistory();
const exportRes = await buildxHistory.export({
Expand Down
6 changes: 6 additions & 0 deletions src/state-helper.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import * as core from '@actions/core';

import {BakeDefinition} from '@docker/actions-toolkit/lib/types/buildx/bake';
import {BuilderInfo} from '@docker/actions-toolkit/lib/types/buildx/builder';

import {Inputs, sanitizeInputs} from './context';

export const tmpDir = process.env['STATE_tmpDir'] || '';
export const inputs = process.env['STATE_inputs'] ? JSON.parse(process.env['STATE_inputs']) : undefined;
export const builder = process.env['STATE_builder'] ? <BuilderInfo>JSON.parse(process.env['STATE_builder']) : undefined;
export const bakeDefinition = process.env['STATE_bakeDefinition'] ? <BakeDefinition>JSON.parse(process.env['STATE_bakeDefinition']) : undefined;
export const buildRefs = process.env['STATE_buildRefs'] ? process.env['STATE_buildRefs'].split(',') : [];

Expand All @@ -17,6 +19,10 @@ export function setInputs(inputs: Inputs) {
core.saveState('inputs', JSON.stringify(sanitizeInputs(inputs)));
}

export function setBuilder(builder: BuilderInfo) {
core.saveState('builder', JSON.stringify(builder));
}

export function setBakeDefinition(bakeDefinition: BakeDefinition) {
core.saveState('bakeDefinition', JSON.stringify(bakeDefinition));
}
Expand Down

0 comments on commit 93d1f86

Please sign in to comment.