File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed
Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change 5757 echo ""
5858
5959 # Extract coverage from CI run (actual)
60- CI_COV=$(npx ts-node --files -e "
61- import fs from 'fs';
62- import path from 'path';
60+ CI_COV=$(node -e "
61+ const fs = require('fs');
6362 const content = fs.readFileSync('coverage/lcov.info', 'utf8').replace(/\r\n/g, '\n');
6463 let linesFound = 0, linesHit = 0;
6564 content.split('\n').forEach(line => {
@@ -70,10 +69,24 @@ jobs:
7069 ")
7170
7271 # Extract PR baseline (what developer committed)
73- PR_BASELINE=$(cat coverage-baseline.json | grep -o '"lines":"[^"]*"' | cut -d'"' -f4)
72+ PR_BASELINE=$(node -e "
73+ try {
74+ const data = require('./coverage-baseline.json');
75+ console.log(data.lines || '0');
76+ } catch(e) {
77+ console.log('0');
78+ }
79+ ")
7480
7581 # Extract main baseline (production baseline)
76- MAIN_BASELINE=$(cat coverage-baseline-main.json | grep -o '"lines":"[^"]*"' | cut -d'"' -f4 || echo "0")
82+ MAIN_BASELINE=$(node -e "
83+ try {
84+ const data = require('./coverage-baseline-main.json');
85+ console.log(data.lines || '0');
86+ } catch(e) {
87+ console.log('0');
88+ }
89+ ")
7790
7891 echo "📊 Coverage Results (Lines):"
7992 echo " CI (actual): ${CI_COV}% ← Fresh coverage from this PR"
You can’t perform that action at this time.
0 commit comments