1
0
Fork 0

Fix the job summary table example

This updates the example of adding a table to a job summary using
core.summary.addTable() to be correct. It also changes the data row to
use strings instead of objects to show both ways that cell data can be
defined. This mirrors the job summary announcement blog post.
pull/1892/head
Nicholas McDonnell 2024-12-05 06:05:27 -05:00
parent b7a00a3203
commit 5a6ce5cd28
No known key found for this signature in database
GPG Key ID: 7994ADE2A56BE5D1
1 changed files with 8 additions and 8 deletions

View File

@ -451,17 +451,17 @@ For example
```typescript
const tableData = [
{data: 'Header1', header: true},
{data: 'Header2', header: true},
{data: 'Header3', header: true},
{data: 'MyData1'},
{data: 'MyData2'},
{data: 'MyData3'}
[
{data: 'Header1', header: true},
{data: 'Header2', header: true},
{data: 'Header3', header: true}
],
['MyData1', 'MyData2', 'MyData3']
]
// Add an HTML table
core.summary.addTable([tableData])
// Output: <table><tr><th>Header1</th><th>Header2</th><th>Header3</th></tr><tr></tr><td>MyData1</td><td>MyData2</td><td>MyData3</td></tr></table>
core.summary.addTable(tableData)
// Output: <table><tr><th>Header1</th><th>Header2</th><th>Header3</th></tr><tr><td>MyData1</td><td>MyData2</td><td>MyData3</td></tr></table>
```