Skip to content

Commit 5474be6

Browse files
committed
fix trim it
1 parent 52d4a6c commit 5474be6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

dev-packages/size-limit-gh-action/index.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ class SizeLimit {
8181
}
8282

8383
parseResults(output) {
84-
const results = JSON.parse(output);
84+
// Ignore any output before `[`, as the command itself may be logged...
85+
const stripped = output.slice(output.indexOf('[')).trim();
86+
87+
const results = JSON.parse(stripped);
8588

8689
return results.reduce((current, result) => {
8790
let time = {};
@@ -251,7 +254,6 @@ async function run() {
251254
current = limit.parseResults(output);
252255
} catch (error) {
253256
core.error('Error parsing size-limit output. The output should be a json.');
254-
core.error(output);
255257
throw error;
256258
}
257259

0 commit comments

Comments
 (0)