mirror of https://github.com/actions/toolkit
Small fix for `addTable` method
There was an issue with the `tableData` object. Each row needs to be an array.pull/1767/head
parent
361a115e53
commit
364af2caa9
|
@ -451,16 +451,19 @@ 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},
|
||||
], [
|
||||
{data: 'MyData1'},
|
||||
{data: 'MyData2'},
|
||||
{data: 'MyData3'}
|
||||
]
|
||||
];
|
||||
|
||||
// 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>
|
||||
|
||||
```
|
||||
|
@ -483,4 +486,4 @@ core.summary.emptyBuffer()
|
|||
|
||||
// Writes text in the buffer to the summary buffer file and empties the buffer, optionally overwriting all existing content in the summary file with buffer contents. Defaults to false.
|
||||
core.summary.write({overwrite: true})
|
||||
```
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue