From 3b24b73988232aefbe8267c97ebd34d4bbc02216 Mon Sep 17 00:00:00 2001 From: Mai-Lapyst Date: Sat, 20 Apr 2024 04:41:52 +0200 Subject: [PATCH 1/2] Handle group commands Add handling of the `::group::` and `::endgroup::` command to produce github like results. --- internal/pkg/report/reporter.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/pkg/report/reporter.go b/internal/pkg/report/reporter.go index 0930e88..a751858 100644 --- a/internal/pkg/report/reporter.go +++ b/internal/pkg/report/reporter.go @@ -392,12 +392,13 @@ func (r *Reporter) handleCommand(originalContent, command, parameters, value str // Not implemented yet, so just return the original content. return &originalContent case "group": - // Returning the original content, because I think the frontend - // will use it when rendering the output. - return &originalContent + // Rewriting into ##[] syntax which the frontend understands + content := "##[group]" + value + return &content case "endgroup": // Ditto - return &originalContent + content := "##[endgroup]" + return &content case "stop-commands": r.stopCommandEndToken = value return nil From f45d0855ad37fb47c97bfdd39cff79957569e12b Mon Sep 17 00:00:00 2001 From: Mai-Lapyst Date: Sat, 20 Apr 2024 08:21:35 +0200 Subject: [PATCH 2/2] Update tests --- internal/pkg/report/reporter_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/pkg/report/reporter_test.go b/internal/pkg/report/reporter_test.go index d3d4c12..cdb2f21 100644 --- a/internal/pkg/report/reporter_test.go +++ b/internal/pkg/report/reporter_test.go @@ -96,8 +96,8 @@ func TestReporter_parseLogRow(t *testing.T) { "::endgroup::", }, []string{ - "::group::", - "::endgroup::", + "##[group]", + "##[endgroup]", }, }, {