mirror of
https://git.flexiblyrigid.au/actions/bake-action.git
synced 2025-12-06 07:48:05 +08:00
generate GitHub annotations for build checks
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
16
src/main.ts
16
src/main.ts
@@ -119,7 +119,8 @@ actionsToolkit.run(
|
||||
const args: string[] = await context.getArgs(inputs, definition, toolkit);
|
||||
const buildCmd = await toolkit.buildx.getCommand(args);
|
||||
const buildEnv = Object.assign({}, process.env, {
|
||||
BUILDX_BAKE_GIT_AUTH_TOKEN: gitAuthToken
|
||||
BUILDX_BAKE_GIT_AUTH_TOKEN: gitAuthToken,
|
||||
BUILDX_METADATA_WARNINGS: 'true'
|
||||
}) as {
|
||||
[key: string]: string;
|
||||
};
|
||||
@@ -164,6 +165,19 @@ actionsToolkit.run(
|
||||
}
|
||||
});
|
||||
|
||||
const warnings = toolkit.buildxBake.resolveWarnings(metadata);
|
||||
if (refs.length > 0 && warnings && warnings.length > 0) {
|
||||
const annotations = await Buildx.convertWarningsToGitHubAnnotations(warnings, refs);
|
||||
core.debug(`annotations: ${JSON.stringify(annotations, null, 2)}`);
|
||||
if (annotations && annotations.length > 0) {
|
||||
await core.group(`Generating GitHub annotations (${annotations.length} build checks found)`, async () => {
|
||||
for (const annotation of annotations) {
|
||||
core.warning(annotation.message, annotation);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
await core.group(`Check build summary support`, async () => {
|
||||
if (!buildSummaryEnabled()) {
|
||||
core.info('Build summary disabled');
|
||||
|
||||
Reference in New Issue
Block a user