@@ -512,10 +512,10 @@ pub fn construct_branch_protection(
512512 expected_repo : & rust_team_data:: v1:: Repo ,
513513 branch_protection : & rust_team_data:: v1:: BranchProtection ,
514514) -> api:: BranchProtection {
515- let uses_homu = branch_protection. merge_bots . contains ( & MergeBot :: Homu ) ;
516- // When homu manages a branch, we should not require a PR nor approvals
517- // for that branch, because homu pushes to these branches directly.
518- let branch_protection_mode = if uses_homu {
515+ let uses_merge_bot = ! branch_protection. merge_bots . is_empty ( ) ;
516+ // When a merge bot manages a branch, we should not require a PR nor approvals
517+ // for that branch, because it will (force) push to these branches directly.
518+ let branch_protection_mode = if uses_merge_bot {
519519 BranchProtectionMode :: PrNotRequired
520520 } else {
521521 branch_protection. mode . clone ( )
@@ -542,10 +542,16 @@ pub fn construct_branch_protection(
542542 } )
543543 . collect ( ) ;
544544
545- if uses_homu {
546- push_allowances. push ( PushAllowanceActor :: User ( api:: UserPushAllowanceActor {
547- login : "bors" . to_owned ( ) ,
548- } ) ) ;
545+ for merge_bot in & branch_protection. merge_bots {
546+ let allowance = match merge_bot {
547+ MergeBot :: Homu => PushAllowanceActor :: User ( api:: UserPushAllowanceActor {
548+ login : "bors" . to_owned ( ) ,
549+ } ) ,
550+ MergeBot :: RustTimer => PushAllowanceActor :: User ( api:: UserPushAllowanceActor {
551+ login : "rust-timer" . to_owned ( ) ,
552+ } ) ,
553+ } ;
554+ push_allowances. push ( allowance) ;
549555 }
550556
551557 let mut checks = match & branch_protection_mode {
0 commit comments