Readd support for GitlabHook::WikiPage
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
4e330adb6b
commit
db88921290
3 changed files with 57 additions and 23 deletions
|
|
@ -20,7 +20,7 @@ mod types;
|
|||
pub use crate::hooks::forgejo::ForgejoHook;
|
||||
pub use crate::hooks::gitlab::GitlabHook;
|
||||
pub use crate::hooks::types::Hook;
|
||||
use crate::hooks::types::{IssueAction, MergeRequestAction};
|
||||
use crate::hooks::types::{IssueAction, MergeRequestAction, WikiAction};
|
||||
|
||||
pub fn format_hook(hook: &Hook) -> Option<String> {
|
||||
Some(match hook {
|
||||
|
|
@ -129,25 +129,16 @@ pub fn format_hook(hook: &Hook) -> Option<String> {
|
|||
} else {
|
||||
unreachable!()
|
||||
}
|
||||
} /*
|
||||
Hook::WikiPage(page) => {
|
||||
let action = match page.object_attributes.action {
|
||||
WikiPageAction::Update => "updated",
|
||||
WikiPageAction::Create => "created",
|
||||
};
|
||||
format!(
|
||||
"[{}] {} {} wiki page {} <{}>",
|
||||
page.project.name,
|
||||
page.user.name,
|
||||
action,
|
||||
page.object_attributes.title,
|
||||
page.object_attributes.url,
|
||||
)
|
||||
}
|
||||
_ => {
|
||||
debug!("Hook not supported");
|
||||
return None;
|
||||
}
|
||||
*/
|
||||
}
|
||||
Hook::Wiki(page) => {
|
||||
let action = match page.action {
|
||||
WikiAction::Update => "updated",
|
||||
WikiAction::Create => "created",
|
||||
};
|
||||
format!(
|
||||
"[{}] {} {} wiki page {} <{}>",
|
||||
page.repository.name, page.author.name, action, page.title, page.url,
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue