Better tag_push message

This commit is contained in:
Brian Tarricone 2023-09-16 00:50:28 -07:00
parent 11be50d89f
commit d74c30132c

View File

@ -223,8 +223,10 @@ impl GitlabEventExt for GitlabEvent {
GitlabEvent::TagPush {
checkout_sha, commits, ..
} => find_commit(commits, &checkout_sha)
.map(|commit| commit.title.clone())
.unwrap_or_else(|| "New tag pushed".to_string()),
.iter()
.fold("New tag pushed".to_string(), |accum, commit| {
format!("{} ({})", accum, commit.title)
}),
GitlabEvent::MergeRequest { object_attributes, .. } => {
format!("MR {}: {}", object_attributes.action.as_str(), object_attributes.title)
}