File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -487,6 +487,22 @@ 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) ;
494
+ if let Err ( err) = issue
495
+ . add_labels ( & ctx. github , vec ! [ github:: Label { name: t_label } ] )
496
+ . await
497
+ {
498
+ if let Some ( github:: UnknownLabels { .. } ) = err. downcast_ref ( ) {
499
+ log:: warn!( "Error assigning label: {}" , err) ;
500
+ } else {
501
+ return Err ( err) ;
502
+ }
503
+ }
504
+ }
505
+
490
506
match find_reviewer_from_names ( & teams, config, issue, & [ name] ) {
491
507
Ok ( assignee) => assignee,
492
508
Err ( e) => {
You can’t perform that action at this time.
0 commit comments