File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -59,16 +59,16 @@ jobs:
5959 try {
6060 const headStats = JSON.parse(fs.readFileSync(`./head-stats/${pkg}/stats.json`, 'utf8'));
6161 const baseStats = JSON.parse(fs.readFileSync(`./base-stats/${pkg}/stats.json`, 'utf8'));
62-
62+
6363 // Simple size comparison - adjust based on your stats.json structure
6464 const headSize = headStats.bundleSize || headStats.size || 0;
6565 const baseSize = baseStats.bundleSize || baseStats.size || 0;
6666 const diff = headSize - baseSize;
6767 const diffPercent = baseSize ? ((diff / baseSize) * 100).toFixed(2) : 0;
68-
68+
6969 const icon = diff > 0 ? '📈' : diff < 0 ? '📉' : '➡️';
7070 const sign = diff > 0 ? '+' : '';
71-
71+
7272 commentBody += `### ${icon} ${pkg}\n`;
7373 commentBody += `- Base: ${(baseSize / 1024).toFixed(2)} KB\n`;
7474 commentBody += `- Head: ${(headSize / 1024).toFixed(2)} KB\n`;
8686 issue_number: prNumber,
8787 });
8888
89- const botComment = comments.data.find(comment =>
90- comment.user.type === 'Bot' &&
89+ const botComment = comments.data.find(comment =>
90+ comment.user.type === 'Bot' &&
9191 comment.body.includes('Bundle Size Comparison')
9292 );
9393
You can’t perform that action at this time.
0 commit comments