From 9a042ecafd2eceb706df11019075d596f953c5d7 Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Fri, 2 Oct 2026 04:33:59 +0100 Subject: [PATCH] fix(go-pr): read only the total line of the coverage report The coverage step matched every line that contains the word total, so a function name such as subtotal added a second value. GitHub then rejected the multi-line step output. The step now reads the line that starts with total:. --- .github/workflows/go-pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go-pr.yaml b/.github/workflows/go-pr.yaml index 8ac9a91..c1cc8fe 100644 --- a/.github/workflows/go-pr.yaml +++ b/.github/workflows/go-pr.yaml @@ -337,7 +337,7 @@ jobs: - name: Calculate coverage id: coverage run: | - COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | sed 's/%//') + COVERAGE=$(go tool cover -func=coverage.out | awk '/^total:/ {print $3}' | sed 's/%//') echo "coverage=$COVERAGE" >> $GITHUB_OUTPUT echo "Total Coverage: $COVERAGE%"