From 090e2ee1d3841cd163c8104fa579d22639a81cea Mon Sep 17 00:00:00 2001 From: Daniel Cazzulino Date: Thu, 4 Jul 2024 03:23:39 -0300 Subject: [PATCH] Render badges in GH using shields.io Far better than just emojis --- src/dotnet-trx/TrxCommand.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/dotnet-trx/TrxCommand.cs b/src/dotnet-trx/TrxCommand.cs index 88907cf..6e97d2c 100644 --- a/src/dotnet-trx/TrxCommand.cs +++ b/src/dotnet-trx/TrxCommand.cs @@ -230,17 +230,19 @@ static void GitHubReport(Summary summary, StringBuilder details) var sb = new StringBuilder() .AppendLine( $""" - :point_right: Run {summary.Total} tests in ~ {summary.Duration.Humanize()} + :point_right: Run {summary.Total} tests in ~ {summary.Duration.Humanize()}: + """); if (summary.Passed > 0) - sb.AppendLine($"     :white_check_mark: {summary.Passed} passed"); + sb.Append($"![{summary.Passed} passed](https://img.shields.io/badge/passed-{summary.Passed}-brightgreen) "); if (summary.Failed > 0) - sb.AppendLine($"     :x: {summary.Failed} failed"); + sb.Append($"![{summary.Failed} failed](https://img.shields.io/badge/failed-{summary.Failed}-red) "); if (summary.Skipped > 0) - sb.AppendLine($"     :grey_question: {summary.Skipped} skipped"); + sb.Append($"![{summary.Skipped} skipped](https://img.shields.io/badge/skipped-{summary.Skipped}-silver) "); sb.AppendLine(); + if (summary.Total > 0) { sb.Append(details);