Skip to content
This repository was archived by the owner on Oct 11, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 5 additions & 40 deletions src/webhook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1692,23 +1692,10 @@ async fn merge(
log::info!("{} merged successfully.", pr.html_url);
if repo_name == "substrate" {
log::info!("Checking for companion.");
if let Some(label) = &pr.head.label {
if let Some(body) = &pr.body {
let _ = check_companion(github_bot, &body, &label).await;
} else {
log::info!("No PR body found.");
}
if let Some(body) = &pr.body {
let _ = check_companion(github_bot, &body).await;
} else {
if let Some(body) = &pr.body {
let _ = check_companion(
github_bot,
&body,
&format!("paritytech:{}", pr.head.ref_field),
)
.await;
} else {
log::info!("No PR body found.");
}
log::info!("No PR body found.");
}
}
}
Expand All @@ -1717,8 +1704,9 @@ async fn merge(
async fn check_companion(
github_bot: &GithubBot,
body: &str,
head: &str,
// head: &str,
) -> Result<()> {
// check for link in pr body
if let Some((comp_html_url, comp_owner, comp_repo, comp_number)) =
companion_parse(&body)
{
Expand Down Expand Up @@ -1754,29 +1742,6 @@ async fn check_companion(
)
.await?;
}
} else if let Ok(Some(PullRequest {
html_url: comp_html_url,
number: comp_number,
head: Head {
ref_field: comp_head_branch,
..
},
..
})) = github_bot
.pull_request_with_head("paritytech", "polkadot", &format!("{}", head))
.await
{
update_companion(
github_bot,
&comp_html_url,
"paritytech",
"polkadot",
comp_number,
"paritytech",
"polkadot",
&comp_head_branch,
)
.await?;
} else {
log::info!("No companion found.");
}
Expand Down