Skip to content
This repository was archived by the owner on Nov 14, 2025. It is now read-only.

Commit f7c2535

Browse files
authored
Add support for assigning cc'ed users to issues if available triagers are present (#335)
1 parent a41d53b commit f7c2535

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

classifier-deep/apply/apply-labels/index.js

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

classifier-deep/apply/apply-labels/index.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,24 @@ class ApplyLabels extends Action {
163163
safeLog('Acquired list of available triagers');
164164
const available = triagers;
165165
if (available) {
166+
// Check if the issue has any cc'ed users and assign them if they are available
167+
const issueBody = issueData.body;
168+
const ccMatches = (issueBody.match(/@(\w+)/g) || []).map((match) =>
169+
match.replace('@', ''),
170+
);
171+
172+
for (const ccMatch of ccMatches) {
173+
if (available.includes(ccMatch)) {
174+
safeLog("assigning cc'ed user", ccMatch);
175+
await issue.addAssignee(ccMatch);
176+
performedAssignment = true;
177+
}
178+
}
179+
180+
if (performedAssignment) {
181+
continue;
182+
}
183+
166184
// Shuffle the array
167185
for (let i = available.length - 1; i > 0; i--) {
168186
const j = Math.floor(Math.random() * (i + 1));

0 commit comments

Comments
 (0)