diff --git a/collector/src/compile/execute/rustc.rs b/collector/src/compile/execute/rustc.rs index c2cc3756f..6d60e1fe6 100644 --- a/collector/src/compile/execute/rustc.rs +++ b/collector/src/compile/execute/rustc.rs @@ -193,9 +193,9 @@ fn checkout(artifact: &ArtifactId) -> anyhow::Result<()> { .current_dir("rust") .arg("fetch") .arg("origin") - .arg("master") + .arg("HEAD") .status() - .context("git fetch origin master")?; + .context("git fetch origin HEAD")?; assert!(status.success(), "git fetch successful"); } else { let status = Command::new("git") diff --git a/site/src/api.rs b/site/src/api.rs index 460be9317..c18d0ab4f 100644 --- a/site/src/api.rs +++ b/site/src/api.rs @@ -647,6 +647,12 @@ pub mod github { pub head_commit: HeadCommit, pub before: String, pub commits: Vec, + pub repository: Repository, + } + + #[derive(Debug, Clone, Serialize, Deserialize)] + pub struct Repository { + pub default_branch: String, } #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/site/src/request_handlers/github.rs b/site/src/request_handlers/github.rs index 5eb76a6e4..9fc313a13 100644 --- a/site/src/request_handlers/github.rs +++ b/site/src/request_handlers/github.rs @@ -23,7 +23,9 @@ pub async fn handle_github( async fn handle_push(ctxt: Arc, push: github::Push) -> ServerResult { let gh_client = client::Client::from_ctxt(&ctxt, RUST_REPO_GITHUB_API_URL.to_owned()); - if push.r#ref != "refs/heads/master" || push.sender.login != "bors" { + if push.r#ref != format!("refs/heads/{}", push.repository.default_branch) + || push.sender.login != "bors" + { return Ok(github::Response); } let rollup_pr_number = match rollup_pr_number(&gh_client, &push.head_commit.message).await? {