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

Function main

github-actions/unified-status-check/lib/main.ts:19–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17];
18
19async function main() {
20 const github = new Octokit({auth: await getAuthTokenFor(ANGULAR_ROBOT)});
21
22 try {
23 /** The pull request triggering the event */
24 const pullRequest = await PullRequest.get(github);
25 /** The results of the validation functions, organized by validation result state. */
26 const validationResultByState: ValidationResults = {
27 pending: [],
28 success: [],
29 failure: [],
30 };
31
32 // Run all of the validators and sort the results.
33 validators.forEach((validator) => {
34 const result = validator(pullRequest);
35 validationResultByState[result.state].push(result);
36 });
37
38 await pullRequest.setCheckResult(buildCheckResultOutput(validationResultByState, pullRequest));
39 } finally {
40 await revokeActiveInstallationToken(github);
41 }
42}
43
44main().catch((err) => {
45 console.error(err);

Callers 1

main.tsFile · 0.70

Calls 6

getAuthTokenForFunction · 0.85
buildCheckResultOutputFunction · 0.85
setCheckResultMethod · 0.80
getMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected