Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"@actions/http-client": "^2.2.3",
"@actions/io": "^1.1.3",
"@actions/tool-cache": "^2.0.2",
"@azure/core-http": "^3.0.0",
"@azure/storage-blob": "^12.15.0",
"@octokit/core": "^5.1.0",
"@octokit/plugin-rest-endpoint-methods": "^10.4.0",
Expand Down
30 changes: 29 additions & 1 deletion src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {SummaryTableCell} from '@actions/core/lib/summary';
import * as github from '@actions/github';
import {GitHub as Octokit} from '@actions/github/lib/utils';
import {Context} from '@actions/github/lib/context';
import {TransferProgressEvent} from '@azure/core-http';
import {type TransferProgressEvent} from '@azure/core-http';
import {BlobClient, BlobHTTPHeaders} from '@azure/storage-blob';
import {jwtDecode, JwtPayload} from 'jwt-decode';

Expand Down Expand Up @@ -347,4 +347,32 @@ export class GitHub {
core.info(`Writing summary`);
await sum.addSeparator().write();
}

public static async writeCloudSummary(refs: Array<{platform: string; refId: string}>) {
if (refs.length > 0) {
const sum = core.summary.addHeading('Docker Build Cloud summary', 2);
sum.addRaw('<p>Your builds were executed using Docker Build Cloud. You can view detailed build information, logs, and results for each build below:</p>');

// Build the table rows
const tableRows = [
[
{header: true, data: 'Platform'},
{header: true, data: 'Build ID'},
{header: true, data: 'Link'}
]
];
for (const {platform, refId} of refs) {
const buildUrl = `https://app.docker.com/build/accounts/docker/builds/${platform}/${refId}`;
tableRows.push([
{header: false, data: platform},
{header: false, data: refId},
{header: false, data: `<a href="${buildUrl}">${buildUrl}</a>`}
]);
core.info(`View build details: ${buildUrl}`);
}
sum.addTable(tableRows);
sum.addRaw('<p>').addRaw('For more information about Docker Build Cloud, see ').addLink('the documentation', 'https://docs.docker.com/build/cloud/').addRaw('.').addRaw('</p>');
await sum.addSeparator().write();
}
}
}
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,7 @@ __metadata:
"@actions/http-client": ^2.2.3
"@actions/io": ^1.1.3
"@actions/tool-cache": ^2.0.2
"@azure/core-http": ^3.0.0
"@azure/storage-blob": ^12.15.0
"@octokit/core": ^5.1.0
"@octokit/plugin-rest-endpoint-methods": ^10.4.0
Expand Down
Loading