From c707aa5c3521b488c9204e7c9c04a10e809f30d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Wed, 24 Jul 2024 19:45:04 +0200 Subject: [PATCH] Gitlab Webhook: Support tag pushes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- src/hook.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/hook.rs b/src/hook.rs index a3e09ee..c58610b 100644 --- a/src/hook.rs +++ b/src/hook.rs @@ -33,6 +33,14 @@ impl From for Hook { pub fn format_hook(glh: &GitlabHook) -> Option { Some(match glh { + GitlabHook::Push(push) if push.object_kind == "tag_push" => { + format!( + "[{}] {} pushed tag {}.", + push.project.name, + push.user_name, + push.ref_.strip_prefix("refs/tags/").unwrap_or("?!"), + ) + }, GitlabHook::Push(push) => { if push.ref_ != "refs/heads/main" { // Ignore: Action not on 'main' branch