Skip to content

Commit 40eeac1

Browse files
authored
feat: expand googler check in auto-assignment to GoogleCloudPlatform and googleapis orgs (#8675)
1 parent 5a01171 commit 40eeac1

1 file changed

Lines changed: 18 additions & 15 deletions

File tree

.github/workflows/assign-reviewers.yml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,24 @@ jobs:
3737
if (isGoogler) {
3838
console.log(`${author} is a trusted bot. Treating as Googler.`);
3939
} else {
40-
// 1. Check if the author is a member of the 'googlers' organization
41-
try {
42-
const res = await github.rest.orgs.checkMembershipForUser({
43-
org: 'googlers',
44-
username: author,
45-
});
46-
if (res.status === 204) {
47-
isGoogler = true;
48-
console.log(`${author} is a member of 'googlers' organization.`);
49-
}
50-
} catch (error) {
51-
if (error.status === 404) {
52-
console.log(`${author} is NOT a member of 'googlers' organization.`);
53-
} else {
54-
console.warn(`Could not check membership in 'googlers' organization: Status ${error.status}. Proceeding as non-member.`);
40+
const orgs = ['googlers', 'GoogleCloudPlatform', 'googleapis'];
41+
for (const org of orgs) {
42+
try {
43+
const res = await github.rest.orgs.checkMembershipForUser({
44+
org: org,
45+
username: author,
46+
});
47+
if (res.status === 204) {
48+
isGoogler = true;
49+
console.log(`${author} is a member of '${org}' organization.`);
50+
break;
51+
}
52+
} catch (error) {
53+
if (error.status === 404) {
54+
console.log(`${author} is NOT a member of '${org}' organization.`);
55+
} else {
56+
console.warn(`Could not check membership in '${org}' organization: Status ${error.status}.`);
57+
}
5558
}
5659
}
5760
}

0 commit comments

Comments
 (0)