From c16bfe52e265cb5c54796b3ab6a276088e0857f6 Mon Sep 17 00:00:00 2001 From: Nadia Barbosa Date: Wed, 13 Mar 2019 12:29:36 -0700 Subject: [android, ios] Fix issue in binary size script --- scripts/publish_binary_size.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'scripts/publish_binary_size.js') diff --git a/scripts/publish_binary_size.js b/scripts/publish_binary_size.js index d506596c33..d00bb4bdbe 100755 --- a/scripts/publish_binary_size.js +++ b/scripts/publish_binary_size.js @@ -96,18 +96,22 @@ function query(after) { if (!suite) continue; - - const runs = commit.checkSuites.nodes[0].checkRuns.nodes; + const allRuns = commit.checkSuites.nodes[0].checkRuns.nodes; + + const sizeCheckRuns = allRuns.filter(function (run) { + return run.name.match(/Size - (\w+) ([\w-]+)/); + }); + const row = [`${commit.oid.slice(0, 7)} - ${commit.messageHeadline}`]; for (let i = 0; i < platforms.length; i++) { const {platform, arch} = platforms[i]; - const run = runs.find((run) => { + const run = sizeCheckRuns.find((run) => { const [, p, a] = run.name.match(/Size - (\w+) ([\w-]+)/); return platform === p && arch === a; }); - + row[i + 1] = run ? +run.summary.match(/is (\d+) bytes/)[1] : undefined; } rows.push(row); -- cgit v1.2.1