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:
59
59
try {
60
60
const headStats = JSON.parse(fs.readFileSync(`./head-stats/${pkg}/stats.json`, 'utf8'));
61
61
const baseStats = JSON.parse(fs.readFileSync(`./base-stats/${pkg}/stats.json`, 'utf8'));
62
-
62
+
63
63
// Simple size comparison - adjust based on your stats.json structure
64
64
const headSize = headStats.bundleSize || headStats.size || 0;
65
65
const baseSize = baseStats.bundleSize || baseStats.size || 0;
66
66
const diff = headSize - baseSize;
67
67
const diffPercent = baseSize ? ((diff / baseSize) * 100).toFixed(2) : 0;
68
-
68
+
69
69
const icon = diff > 0 ? '📈' : diff < 0 ? '📉' : '➡️';
70
70
const sign = diff > 0 ? '+' : '';
71
-
71
+
72
72
commentBody += `### ${icon} ${pkg}\n`;
73
73
commentBody += `- Base: ${(baseSize / 1024).toFixed(2)} KB\n`;
74
74
commentBody += `- Head: ${(headSize / 1024).toFixed(2)} KB\n`;
86
86
issue_number: prNumber,
87
87
});
88
88
89
- const botComment = comments.data.find(comment =>
90
- comment.user.type === 'Bot' &&
89
+ const botComment = comments.data.find(comment =>
90
+ comment.user.type === 'Bot' &&
91
91
comment.body.includes('Bundle Size Comparison')
92
92
);
93
93
You can’t perform that action at this time.
0 commit comments