8000 github: fix summary handling for dbc by crazy-max · Pull Request #707 · docker/actions-toolkit · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

github: fix summary handling for dbc #707

8000
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 27, 2025
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
0