Refactoring & cleanup of whole codebase

Improves report summary and annotations
This commit is contained in:
Michal Dorner 2021-01-31 20:47:55 +01:00
parent 07a0223ee3
commit 60b35d601a
No known key found for this signature in database
GPG key ID: 9EEE04B48DA36786
20 changed files with 38784 additions and 33667 deletions

View file

@ -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)
}
}