mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-16 22:37:09 +01:00
Feature: Add summary title
Add new option `report-title` to add H1 title to the Markdown report Resolves #540
This commit is contained in:
parent
d1bf678c89
commit
0841c8130e
20 changed files with 65 additions and 8 deletions
23
src/main.ts
23
src/main.ts
|
|
@ -47,6 +47,7 @@ class TestReporter {
|
|||
readonly onlySummary = core.getInput('only-summary', {required: false}) === 'true'
|
||||
readonly useActionsSummary = core.getInput('use-actions-summary', {required: false}) === 'true'
|
||||
readonly badgeTitle = core.getInput('badge-title', {required: false})
|
||||
readonly reportTitle = core.getInput('report-title', {required: false})
|
||||
readonly token = core.getInput('token', {required: true})
|
||||
readonly octokit: InstanceType<typeof GitHub>
|
||||
readonly context = getCheckRunContext()
|
||||
|
|
@ -164,11 +165,19 @@ class TestReporter {
|
|||
}
|
||||
}
|
||||
|
||||
const {listSuites, listTests, onlySummary, useActionsSummary, badgeTitle} = this
|
||||
const {listSuites, listTests, onlySummary, useActionsSummary, badgeTitle, reportTitle} = this
|
||||
|
||||
let baseUrl = ''
|
||||
if (this.useActionsSummary) {
|
||||
const summary = getReport(results, {listSuites, listTests, baseUrl, onlySummary, useActionsSummary, badgeTitle})
|
||||
const summary = getReport(results, {
|
||||
listSuites,
|
||||
listTests,
|
||||
baseUrl,
|
||||
onlySummary,
|
||||
useActionsSummary,
|
||||
badgeTitle,
|
||||
reportTitle
|
||||
})
|
||||
|
||||
core.info('Summary content:')
|
||||
core.info(summary)
|
||||
|
|
@ -188,7 +197,15 @@ class TestReporter {
|
|||
|
||||
core.info('Creating report summary')
|
||||
baseUrl = createResp.data.html_url as string
|
||||
const summary = getReport(results, {listSuites, listTests, baseUrl, onlySummary, useActionsSummary, badgeTitle})
|
||||
const summary = getReport(results, {
|
||||
listSuites,
|
||||
listTests,
|
||||
baseUrl,
|
||||
onlySummary,
|
||||
useActionsSummary,
|
||||
badgeTitle,
|
||||
reportTitle
|
||||
})
|
||||
|
||||
core.info('Creating annotations')
|
||||
const annotations = getAnnotations(results, this.maxAnnotations)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue