Skip to content

Commit eed7ed7

Browse files
Fix/yarn hardened mode ci (#550)
* ci: disable Yarn hardened mode for public PR installs Yarn 4 auto-enables hardened mode on public PRs, blocking lockfile updates from dependabot. Set YARN_ENABLE_HARDENED_MODE=0 on the install step in all three jobs so CI can complete. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * ci: clean up coverage bot output - Strip ANSI escape codes from test files line so it renders cleanly in markdown - Drop delta display when change is zero (was showing noisy '●+0.00%') Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 26db5e1 commit eed7ed7

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/test.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,16 @@ jobs:
157157
let baseline = null;
158158
try { baseline = parseAllFiles(fs.readFileSync('/tmp/baseline/coverage-summary.txt', 'utf8')); } catch {}
159159
160+
const stripAnsi = s => s.replace(/\x1b\[[0-9;]*m/g, '');
161+
160162
const fmt = (val, baseVal) => {
161163
const str = `**${val.toFixed(2)}%**`;
162164
if (baseline === null || isNaN(baseVal)) return str;
163-
const d = (val - baseVal).toFixed(2);
164-
const sign = d >= 0 ? '+' : '';
165-
const color = d > 0 ? '▲' : d < 0 ? '▼' : '●';
166-
return `${str} ${color}${sign}${d}%`;
165+
const d = val - baseVal;
166+
if (Math.abs(d) < 0.005) return str;
167+
const sign = d > 0 ? '+' : '';
168+
const arrow = d > 0 ? '▲' : '▼';
169+
return `${str} ${arrow}${sign}${d.toFixed(2)}%`;
167170
};
168171
169172
let coverageLine = '_Coverage data not found_';
@@ -177,7 +180,7 @@ jobs:
177180
].join(' | ');
178181
}
179182
180-
const testLine = lines.find(l => l.includes('Test Files')) || '';
183+
const testLine = lines.map(stripAnsi).find(l => l.includes('Test Files')) || '';
181184
const body = [
182185
'## Coverage',
183186
coverageLine,

0 commit comments

Comments
 (0)