From 851e8553ec67972d0053d71d8232d6fb3645c25e Mon Sep 17 00:00:00 2001 From: Cintia Sanchez Garcia Date: Fri, 6 Sep 2024 13:17:17 +0200 Subject: [PATCH] Use truncate_no_dots filter Signed-off-by: Cintia Sanchez Garcia --- dco2/templates/output.md | 2 -- dco2/templates/summary.md | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/dco2/templates/output.md b/dco2/templates/output.md index c8a30b8..2e5100a 100644 --- a/dco2/templates/output.md +++ b/dco2/templates/output.md @@ -23,5 +23,3 @@ {%~ include "how_to_fix.md" +%} {% endif %} - -{% let x = "hello".to_string()|truncate_no_dots(2) %} diff --git a/dco2/templates/summary.md b/dco2/templates/summary.md index 2017bc6..1440bf1 100644 --- a/dco2/templates/summary.md +++ b/dco2/templates/summary.md @@ -5,8 +5,7 @@ | | Sha | Message | Pass or fail reason | | -- | ---- | :---- | :---- | {%+ for entry in commits %} - {% let (sha_truncated, rest) = entry.commit.sha.split_at(8) %} - {% let message = entry.commit.message.split_once('\n') %} + {% let sha_truncated = entry.commit.sha.to_string()|truncate_no_dots(7) %} {% let subject = entry.commit.message.lines().next().unwrap_or_default() %} {% if entry.errors.is_empty() %} | :green_circle: | [{{ sha_truncated }}]({{ entry.commit.html_url }}) | {{ subject|truncate(50) }} | {% if let Some(success_reason) = entry.success_reason %}`{{ success_reason|capitalize }}`{% endif %} |