Skip to content

Commit

Permalink
Merge pull request #589 from OlesGalatsan/features/add-step-summary-s…
Browse files Browse the repository at this point in the history
…hort-summary
  • Loading branch information
Jozef Izso authored and GitHub committed Jun 8, 2025
2 parents f078ba5 + 9934a5f commit d56352b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
9 changes: 5 additions & 4 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ class TestReporter {

const {listSuites, listTests, onlySummary, useActionsSummary, badgeTitle, reportTitle} = this

const passed = results.reduce((sum, tr) => sum + tr.passed, 0)
const failed = results.reduce((sum, tr) => sum + tr.failed, 0)
const skipped = results.reduce((sum, tr) => sum + tr.skipped, 0)
const shortSummary = `${passed} passed, ${failed} failed and ${skipped} skipped `

let baseUrl = ''
if (this.useActionsSummary) {
const summary = getReport(results, {
Expand All @@ -182,6 +187,7 @@ class TestReporter {

core.info('Summary content:')
core.info(summary)
core.summary.addRaw(`# ${shortSummary}`)
await core.summary.addRaw(summary).write()
} else {
core.info(`Creating check run ${name}`)
Expand Down Expand Up @@ -214,11 +220,6 @@ class TestReporter {
const isFailed = this.failOnError && results.some(tr => tr.result === 'failed')
const conclusion = isFailed ? 'failure' : 'success'

const passed = results.reduce((sum, tr) => sum + tr.passed, 0)
const failed = results.reduce((sum, tr) => sum + tr.failed, 0)
const skipped = results.reduce((sum, tr) => sum + tr.skipped, 0)
const shortSummary = `${passed} passed, ${failed} failed and ${skipped} skipped `

core.info(`Updating check run conclusion (${conclusion}) and output`)
const resp = await this.octokit.rest.checks.update({
check_run_id: createResp.data.id,
Expand Down

0 comments on commit d56352b

Please sign in to comment.