fix: show full branch name on github webhook messages

This commit is contained in:
Zomatree
2025-04-22 16:13:03 +01:00
parent 2a36f5912d
commit a841df3b36

View File

@@ -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::<Vec<_>>().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::<Vec<String>>()
.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::<Vec<String>>()
.join("\n"),
1000
);
SendableEmbed {
title: Some(event.sender.login),