Gitlab Webhook: Support tag pushes
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
edd0e0074a
commit
c707aa5c35
1 changed files with 8 additions and 0 deletions
|
@ -33,6 +33,14 @@ impl From<GitlabHook> for Hook {
|
||||||
|
|
||||||
pub fn format_hook(glh: &GitlabHook) -> Option<String> {
|
pub fn format_hook(glh: &GitlabHook) -> Option<String> {
|
||||||
Some(match glh {
|
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) => {
|
GitlabHook::Push(push) => {
|
||||||
if push.ref_ != "refs/heads/main" {
|
if push.ref_ != "refs/heads/main" {
|
||||||
// Ignore: Action not on 'main' branch
|
// Ignore: Action not on 'main' branch
|
||||||
|
|
Loading…
Reference in a new issue