mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-17 14:57:09 +01:00
Refactoring & cleanup of whole codebase
Improves report summary and annotations
This commit is contained in:
parent
07a0223ee3
commit
60b35d601a
20 changed files with 38784 additions and 33667 deletions
|
|
@ -1,9 +1,6 @@
|
|||
import * as github from '@actions/github'
|
||||
import {EventPayloads} from '@octokit/webhooks'
|
||||
|
||||
import {TestResult} from '../parsers/parser-types'
|
||||
import {ellipsis} from './markdown-utils'
|
||||
|
||||
export function getCheckRunSha(): string {
|
||||
if (github.context.payload.pull_request) {
|
||||
const pr = github.context.payload.pull_request as EventPayloads.WebhookPayloadPullRequestPullRequest
|
||||
|
|
@ -12,14 +9,3 @@ export function getCheckRunSha(): string {
|
|||
|
||||
return github.context.sha
|
||||
}
|
||||
|
||||
export function enforceCheckRunLimits(result: TestResult, maxAnnotations: number): void {
|
||||
// Limit number of created annotations
|
||||
result.annotations.splice(maxAnnotations + 1)
|
||||
|
||||
// Limit number of characters in annotation fields
|
||||
for (const err of result.annotations) {
|
||||
err.title = ellipsis(err.title || '', 255)
|
||||
err.message = ellipsis(err.message, 65535)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue