@@ -487,10 +487,11 @@ pub(super) async fn handle_command(
487487 name. to_string ( )
488488 } else {
489489 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) ;
494495 if let Err ( err) = issue
495496 . add_labels ( & ctx. github , vec ! [ github:: Label { name: t_label } ] )
496497 . await
@@ -503,7 +504,8 @@ pub(super) async fn handle_command(
503504 }
504505 }
505506
506- match find_reviewer_from_names ( & teams, config, issue, & [ name] ) {
507+ match find_reviewer_from_names ( & teams, config, issue, & [ team_name. to_string ( ) ] )
508+ {
507509 Ok ( assignee) => assignee,
508510 Err ( e) => {
509511 issue. post_comment ( & ctx. github , & e. to_string ( ) ) . await ?;
0 commit comments