@@ -487,10 +487,11 @@ pub(super) async fn handle_command(
487
487
name. to_string ( )
488
488
} else {
489
489
let teams = crate :: team_data:: teams ( & ctx. github ) . await ?;
490
- // Determine if assignee is a team. If yes, add the corresponding label
491
- // team name here is without prefix 't-' (e.g. 'compiler', 'libs', etc.)
492
- if let Some ( team) = teams. teams . get ( & name) {
493
- let t_label = format ! ( "t-{}" , & team. name) ;
490
+ // remove "t-" or "T-" prefixes before checking if it's a team name
491
+ let team_name = name. trim_start_matches ( "t-" ) . trim_start_matches ( "T-" ) ;
492
+ // Determine if assignee is a team. If yes, add the corresponding GH label.
493
+ if teams. teams . get ( team_name) . is_some ( ) {
494
+ let t_label = format ! ( "T-{}" , & team_name) ;
494
495
if let Err ( err) = issue
495
496
. add_labels ( & ctx. github , vec ! [ github:: Label { name: t_label } ] )
496
497
. await
@@ -503,7 +504,8 @@ pub(super) async fn handle_command(
503
504
}
504
505
}
505
506
506
- match find_reviewer_from_names ( & teams, config, issue, & [ name] ) {
507
+ match find_reviewer_from_names ( & teams, config, issue, & [ team_name. to_string ( ) ] )
508
+ {
507
509
Ok ( assignee) => assignee,
508
510
Err ( e) => {
509
511
issue. post_comment ( & ctx. github , & e. to_string ( ) ) . await ?;
0 commit comments