Skip to content
Merged
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
12 changes: 6 additions & 6 deletions src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,15 +233,15 @@ export class GitHub {
return `<a href="${url}">${text}</a>` + (addEOL ? os.EOL : '');
};

const refsSize = Object.keys(opts.exportRes.refs).length;
const singleRef = refsSize === 1 ? Object.keys(opts.exportRes.refs)[0] : undefined;
const singleSummary = singleRef && opts.exportRes.summaries?.[singleRef];
const dbcAccount = opts.driver === 'cloud' && opts.endpoint?.split('/')[0];
const refsSize = opts.exportRes.refs.length;
const firstRef = refsSize > 0 ? opts.exportRes.refs?.[0] : undefined;
const firstSummary = firstRef ? opts.exportRes.summaries?.[firstRef] : undefined;
const dbcAccount = opts.driver === 'cloud' && opts.endpoint ? opts.endpoint?.replace(/^cloud:\/\//, '').split('/')[0] : undefined;

const sum = core.summary.addHeading('Docker Build summary', 2);

if (dbcAccount && singleRef && singleSummary) {
const buildURL = GitHub.formatDBCBuildURL(dbcAccount, singleRef, singleSummary.defaultPlatform);
if (dbcAccount && refsSize === 1 && firstRef && firstSummary) {
const buildURL = GitHub.formatDBCBuildURL(dbcAccount, firstRef, firstSummary.defaultPlatform);
// prettier-ignore
sum.addRaw(`<p>`)
.addRaw(`For a detailed look at the build, you can check the results at:`)
Expand Down
Loading