Skip to content

Commit

Permalink
Update check title and remove icon
Browse files Browse the repository at this point in the history
  • Loading branch information
ldaneliukas authored and j-catania committed Jan 12, 2024
1 parent 08c81a1 commit 4bb68ff
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {SwiftXunitParser} from './parsers/swift-xunit/swift-xunit-parser'

import {normalizeDirPath, normalizeFilePath} from './utils/path-utils'
import {getCheckRunContext} from './utils/github-utils'
import {Icon} from './utils/markdown-utils'

async function main(): Promise<void> {
try {
Expand Down Expand Up @@ -183,15 +182,19 @@ class TestReporter {

const isFailed = this.failOnError && results.some(tr => tr.result === 'failed')
const conclusion = isFailed ? 'failure' : 'success'
const icon = isFailed ? Icon.fail : Icon.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)
let 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,
conclusion,
status: 'completed',
output: {
title: `${name} ${icon}`,
title: shortSummary,
summary,
annotations
},
Expand Down

0 comments on commit 4bb68ff

Please sign in to comment.