hooks: Remove restriction to be published on main

Signed-off-by: pep <pep@bouah.net>
This commit is contained in:
pep 2025-12-17 16:01:55 +01:00
commit 1c3af01142
No known key found for this signature in database
GPG key ID: DEDA74AEECA9D0F2

View file

@ -33,20 +33,16 @@ pub fn format_hook(hook: &Hook) -> Option<String> {
) )
} }
Hook::Push(push) => { Hook::Push(push) => {
if push.ref_ != "refs/heads/main" {
// Ignore: Action not on 'main' branch
return None;
}
// Unlikely to be reached as 'main' is probably never going to be deleted
if push.commits.len() == 0 { if push.commits.len() == 0 {
// Ignore: Branch got deleted // Ignore: Branch got deleted
return None; return None;
} }
let mut text = format!( let mut text = format!(
"[{}] {} pushed {} commits to main", "[{}] {} pushed {} commits to {}",
push.repository.name, push.repository.name,
push.pusher.name, push.pusher.name,
push.commits.len(), push.commits.len(),
push.ref_,
); );
// Display max 3 commits // Display max 3 commits
for commit in push.commits.clone().into_iter().take(3) { for commit in push.commits.clone().into_iter().take(3) {