MCPcopy Create free account
hub / github.com/angular/dev-infra / getSummary

Function getSummary

github-actions/unified-status-check/lib/validator.ts:56–91  ·  view source on GitHub ↗
(results: ValidationResults, pullRequest: PullRequest)

Source from the content-addressed store, hash-verified

54}
55
56function getSummary(results: ValidationResults, pullRequest: PullRequest) {
57 return `
58### Validations
59
60#### Failing
61${
62 results.failure.length
63 ? results.failure.map(({description}) => ` - ${description}`).join('\n')
64 : 'No failing validations.'
65}
66
67#### Pending
68${
69 results.pending.length
70 ? results.pending.map(({description}) => ` - ${description}`).join('\n')
71 : 'No pending validations.'
72}
73
74#### Success
75${
76 results.success.length
77 ? results.success.map(({description}) => ` - ${description}`).join('\n')
78 : 'No successful validations.'
79}
80
81
82### Status and Check Results
83${pullRequest.statuses.all
84 .map(({name, state, description}) => {
85 const escapedName = escapeHtml(escapeMarkdown(name));
86 const escapedDescription = description ? escapeHtml(escapeMarkdown(description)) : '';
87 return ` - ${stateToIconMap.get(state)} **${escapedName}**: ${escapedDescription}`;
88 })
89 .join('\n')}
90`;
91}
92
93const stateToIconMap = new Map<NormalizedState, string>([
94 ['failure', '❌'],

Callers 1

buildCheckResultOutputFunction · 0.85

Calls 3

escapeMarkdownFunction · 0.85
escapeHtmlFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected