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

Function main

github-actions/post-approval-changes/lib/main.ts:10–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8const googleOwnedRobots = ['angular-robot'];
9
10async function main() {
11 let repoClient: Octokit | null = null;
12 let googlersOrgClient: Octokit | null = null;
13
14 try {
15 const repoToken = await getAuthTokenFor(ANGULAR_ROBOT, context.repo);
16 const googlersOrgToken = await getGooglersOrgInstallationToken();
17
18 repoClient = new Octokit({auth: repoToken});
19
20 if (googlersOrgToken !== null) {
21 googlersOrgClient = new Octokit({auth: googlersOrgToken});
22 }
23
24 await runPostApprovalChangesAction(googlersOrgClient ?? repoClient, repoClient);
25 } finally {
26 if (googlersOrgClient !== null) {
27 await revokeActiveInstallationToken(googlersOrgClient);
28 }
29 if (repoClient !== null) {
30 await revokeActiveInstallationToken(repoClient);
31 }
32 }
33}
34
35async function getGooglersOrgInstallationToken(): Promise<string | null> {
36 try {

Callers 1

main.tsFile · 0.70

Calls 4

getAuthTokenForFunction · 0.85

Tested by

no test coverage detected