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:.
This commit is contained in:
2026-10-02 04:33:59 +01:00
parent 5390791174
commit 9a042ecafd
+1 -1
View File
@@ -337,7 +337,7 @@ jobs:
- name: Calculate coverage - name: Calculate coverage
id: coverage id: coverage
run: | 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 "coverage=$COVERAGE" >> $GITHUB_OUTPUT
echo "Total Coverage: $COVERAGE%" echo "Total Coverage: $COVERAGE%"