Skip to content

Commit 16a1834

Browse files
committed
Format the summary produced by the info action to be better
1 parent 75057b2 commit 16a1834

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/actions/src/info/index.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import pathlib from 'path';
33
import utils from 'util';
44
import * as core from '@actions/core';
55
import type { SummaryTableRow } from '@actions/core/lib/summary.js';
6+
import packageJson from '../../../../package.json' with { type: 'json' };
67
import { checkForChanges, getGitRoot, type PackageRecord, type RawPackageRecord } from '../commons.js';
78
import { topoSortPackages } from './sorter.js';
89

@@ -213,13 +214,16 @@ async function main() {
213214
const gitRoot = await getGitRoot();
214215
const { packages, bundles, tabs, libs } = await getAllPackages(gitRoot);
215216

217+
const { repository } = packageJson;
216218
const summaryItems = Object.values(packages).map((packageInfo): SummaryTableRow => {
217219
const relpath = pathlib.relative(gitRoot, packageInfo.directory);
220+
const url = new URL(relpath, repository);
221+
218222
return [
219-
packageInfo.name,
220-
relpath,
221-
packageInfo.changes ? 'true' : 'false',
222-
packageInfo.needsPlaywright ? 'true' : 'false'
223+
`<code>${packageInfo.name}</code>`,
224+
`<a href="${url}">${relpath}</a>`,
225+
`<code>${packageInfo.changes ? 'true' : 'false'}</code>`,
226+
`<code>${packageInfo.needsPlaywright ? 'true' : 'false'}</code>`
223227
];
224228
});
225229

@@ -242,6 +246,7 @@ async function main() {
242246
}
243247
]);
244248

249+
core.summary.addHeading('Package Information');
245250
core.summary.addTable(summaryItems);
246251
await core.summary.write();
247252

0 commit comments

Comments
 (0)