From 49e77e48e6c147e37d939c68741c7c3f8723e900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Tue, 23 Aug 2016 14:36:07 +0200 Subject: [PATCH] Attempt to use new Travis API. --- script.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/script.js b/script.js index c037a47..7bf83c5 100644 --- a/script.js +++ b/script.js @@ -188,22 +188,20 @@ function updateChart() { } function filterBuilds(json) { - var rawBuilds = json.builds; - if(console){globall=rawBuilds;console.log(rawBuilds);} - if (typeof rawBuilds.length === 'undefined') { + if (typeof json.builds.length === 'undefined') { alert('invalid repository: ' + repoName); return; } var curOldestBuild = oldestBuild; - rawBuilds.forEach(function(build) { + json.builds.forEach(function(build, idx) { var buildNr = Number(build.number); if (buildNr < curOldestBuild) { curOldestBuild = buildNr; } - if ((onlyMaster && build.branch !== 'master') + if ((onlyMaster && json.commits[idx].branch !== 'master') || (build.state !== 'finished') || (!includeFailed && build.result !== 0) || (build.event_type != "push" && build.event_type != "cron")) {