From a841df3b36126ebaa3890222754ced5002b47b32 Mon Sep 17 00:00:00 2001 From: Zomatree Date: Tue, 22 Apr 2025 16:13:03 +0100 Subject: [PATCH] fix: show full branch name on github webhook messages --- .../routes/webhooks/webhook_execute_github.rs | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/crates/delta/src/routes/webhooks/webhook_execute_github.rs b/crates/delta/src/routes/webhooks/webhook_execute_github.rs index a5b0d12b..6d9c8b60 100644 --- a/crates/delta/src/routes/webhooks/webhook_execute_github.rs +++ b/crates/delta/src/routes/webhooks/webhook_execute_github.rs @@ -788,9 +788,7 @@ pub async fn webhook_execute_github( r#ref, .. }) => { - let Some(branch) = r#ref.split('/').nth(2) else { - return Ok(()); - }; + let branch = r#ref.split('/').skip(2).collect::>().join("/"); if forced { let description = format!( @@ -817,19 +815,22 @@ pub async fn webhook_execute_github( commits.len(), compare ); - let commit_description = commits - .into_iter() - .map(|commit| { - format!( - "[`{}`]({}) {} - {}", - &commit.id[0..=7], - commit.url, - shorten_text(&commit.message, 50), - commit.author.name - ) - }) - .collect::>() - .join("\n"); + let commit_description = shorten_text( + &commits + .into_iter() + .map(|commit| { + format!( + "[`{}`]({}) {} - {}", + &commit.id[0..=7], + commit.url, + shorten_text(&commit.message, 50), + commit.author.name + ) + }) + .collect::>() + .join("\n"), + 1000 + ); SendableEmbed { title: Some(event.sender.login),