actions / toolkit

The GitHub ToolKit for developing GitHub Actions.
https://github.com/features/actions
MIT License
5.02k stars 1.45k forks source link

@actions/core: Add support for full width tables and column width #1766

Open estruyf opened 4 months ago

estruyf commented 4 months ago

Describe the enhancement

With the core.summary.addTable, we can already add a table to the job summary, but we have no control over how the outcome of the table would be. It would be useful to be able to tell if it should be a full width table and defining the column widths would make it perfect.

Code Snippet

// Define full width on the table
core.summary.addTable(tableRows, { fullWidth: true });

// Define the width on the table rows/headers
const tableRows = [
    [
        { data: "title", header: true, width: "20%" },
        { data: "description", header: true, width: "60%" },
        { data: "outcome", header: true, width: "20%" },
    ]
]

Additional information

For more context, I use the https://www.npmjs.com/package/@estruyf/github-actions-reporter dependency in my Playwright tests to report the test outcomes. Right now, each of the test result tables has its own width, depending on the text inserted into it.

image