File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments