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
b7a00a3203
commit
5a6ce5cd28
|
@ -451,17 +451,17 @@ For example
|
||||||
```typescript
|
```typescript
|
||||||
|
|
||||||
const tableData = [
|
const tableData = [
|
||||||
|
[
|
||||||
{data: 'Header1', header: true},
|
{data: 'Header1', header: true},
|
||||||
{data: 'Header2', header: true},
|
{data: 'Header2', header: true},
|
||||||
{data: 'Header3', header: true},
|
{data: 'Header3', header: true}
|
||||||
{data: 'MyData1'},
|
],
|
||||||
{data: 'MyData2'},
|
['MyData1', 'MyData2', 'MyData3']
|
||||||
{data: 'MyData3'}
|
|
||||||
]
|
]
|
||||||
|
|
||||||
// Add an HTML table
|
// Add an HTML table
|
||||||
core.summary.addTable([tableData])
|
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>
|
// 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