hooks: Remove restriction to be published on main
Signed-off-by: pep <pep@bouah.net>
This commit is contained in:
parent
04bae8dc0c
commit
1c3af01142
1 changed files with 2 additions and 6 deletions
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue