Skip to content

Commit 8a3082e

Browse files
thePunderWomanjosephperrott
authored andcommitted
fix(ng-dev): prevent failure on googler check (#2034)
This adds a try catch around the googler org check to make sure the script does not error out when merging PR Close #2034
1 parent 11e2626 commit 8a3082e

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

.github/local-actions/branch-manager/main.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68178,9 +68178,12 @@ var Validation5 = class extends PullRequestValidation {
6817868178

6817968179
//
6818068180
async function isGooglerOrgMember(client, username) {
68181-
const response = await client.orgs.checkMembershipForUser({ org: "googlers", username });
68182-
if (response.status === 204) {
68183-
return true;
68181+
try {
68182+
const response = await client.orgs.checkMembershipForUser({ org: "googlers", username });
68183+
if (response.status === 204) {
68184+
return true;
68185+
}
68186+
} catch {
6818468187
}
6818568188
return false;
6818668189
}

ng-dev/utils/git/github-macros.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ async function isGooglerOrgMember(
1414
client: AuthenticatedGithubClient,
1515
username: string,
1616
): Promise<boolean> {
17-
const response = await client.orgs.checkMembershipForUser({org: 'googlers', username});
18-
if ((response.status as number) === 204) {
19-
return true;
20-
}
17+
try {
18+
const response = await client.orgs.checkMembershipForUser({org: 'googlers', username});
19+
if ((response.status as number) === 204) {
20+
return true;
21+
}
22+
} catch {}
2123
return false;
2224
}
2325

0 commit comments

Comments
 (0)