File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -647,6 +647,12 @@ pub mod github {
647
647
pub head_commit : HeadCommit ,
648
648
pub before : String ,
649
649
pub commits : Vec < Commit > ,
650
+ pub repository : Repository ,
651
+ }
652
+
653
+ #[ derive( Debug , Clone , Serialize , Deserialize ) ]
654
+ pub struct Repository {
655
+ pub default_branch : String ,
650
656
}
651
657
652
658
#[ derive( Debug , Clone , Serialize , Deserialize ) ]
Original file line number Diff line number Diff line change @@ -23,7 +23,9 @@ pub async fn handle_github(
23
23
24
24
async fn handle_push ( ctxt : Arc < SiteCtxt > , push : github:: Push ) -> ServerResult < github:: Response > {
25
25
let gh_client = client:: Client :: from_ctxt ( & ctxt, RUST_REPO_GITHUB_API_URL . to_owned ( ) ) ;
26
- if push. r#ref != "refs/heads/master" || push. sender . login != "bors" {
26
+ if push. r#ref != format ! ( "refs/heads/{}" , push. repository. default_branch)
27
+ || push. sender . login != "bors"
28
+ {
27
29
return Ok ( github:: Response ) ;
28
30
}
29
31
let rollup_pr_number = match rollup_pr_number ( & gh_client, & push. head_commit . message ) . await ? {
You can’t perform that action at this time.
0 commit comments