Skip to content

Commit b88f11b

Browse files
authored
feat: add contributor account loading to bot detection workflow (#15366)
1 parent 19eabf3 commit b88f11b

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

.github/workflows/bot-detection.lock.yml

Lines changed: 19 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/bot-detection.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,23 @@ jobs:
138138
}
139139
}
140140
141+
async function loadContributorAccounts() {
142+
try {
143+
const contributors = await github.paginate(github.rest.repos.listContributors, {
144+
owner,
145+
repo,
146+
per_page: 100,
147+
});
148+
for (const contributor of contributors) {
149+
if (contributor?.login) {
150+
MEMBER_ACCOUNTS.add(String(contributor.login).toLowerCase());
151+
}
152+
}
153+
} catch {
154+
// If contributor lookup fails, continue without contributor allowlist.
155+
}
156+
}
157+
141158
async function loadOrgMembers() {
142159
for (const org of TRUSTED_ORGS) {
143160
try {
@@ -198,6 +215,7 @@ jobs:
198215
}
199216
200217
await loadMemberAccounts();
218+
await loadContributorAccounts();
201219
await loadOrgMembers();
202220
203221
// Search issues + PRs updated in window (API requires is:issue or is:pull-request)

0 commit comments

Comments
 (0)