mirror of https://github.com/actions/toolkit
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
parent
2b08dc18f2
commit
3666511c01
|
@ -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>
|
||||
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue