Skip to content

Commit b692f73

Browse files
committed
fix: correct STATUS parsing from coverage_report.txt
The sed pattern was capturing 'S' from '**Status:**' instead of 'PASSED' or 'FAILED'. Using awk '{print $NF}' to get the last word.
1 parent 4459dae commit b692f73

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

.github/workflows/unit-test-and-coverage-gate.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ jobs:
9696
# Extract numeric values using simpler patterns
9797
OVERALL=$(grep "Overall Coverage:" coverage_report.txt | sed 's/[^0-9.]*\([0-9.]\+\)%.*/\1/')%
9898
THRESHOLD=$(grep "Threshold:" coverage_report.txt | sed 's/[^0-9.]*\([0-9.]\+\)%.*/\1/')%
99-
STATUS=$(grep "Status:" coverage_report.txt | sed 's/[^A-Z]*\([A-Z]\+\).*/\1/')
99+
# Get last word on the Status line (PASSED or FAILED)
100+
STATUS=$(grep "Status:" coverage_report.txt | awk '{print $NF}')
100101
101102
# Status badge
102103
if [[ "$STATUS" == "PASSED" ]]; then

0 commit comments

Comments
 (0)