()
| 8 | const googleOwnedRobots = ['angular-robot']; |
| 9 | |
| 10 | async 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 | |
| 35 | async function getGooglersOrgInstallationToken(): Promise<string | null> { |
| 36 | try { |
no test coverage detected