Skip to content

Commit e49b75b

Browse files
authored
Check all matching jobs per variant (#310)
1 parent eab691b commit e49b75b

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

scripts/badge_aggregation.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,22 @@ module.exports = async function badgeAggregation({ github, context, core, depend
8888

8989
// Match each required variant to a job. We look for the variant in parentheses, e.g. "(latest)".
9090
for (const variant of dep.variants || []) {
91-
const job = jobs.find(j => typeof j.name === 'string' && j.name.includes(variant));
91+
const matchingJobs = jobs.filter(
92+
j => typeof j.name === 'string' && j.name.includes(variant)
93+
);
9294

93-
if (!job) {
95+
if (matchingJobs.length === 0) {
9496
failures.push(`Missing job for ${dep.label} (variant: ${variant})`);
9597
continue;
9698
}
9799

98-
core.info(`[${dep.label}] ${job.name} => ${job.conclusion}`);
100+
for (const job of matchingJobs) {
101+
core.info(`[${dep.label}] ${job.name} => ${job.conclusion}`);
99102

100-
// Accept only a strict "success".
101-
if (job.conclusion !== 'success') {
102-
failures.push(`${dep.label} (${job.name}) concluded ${job.conclusion}`);
103+
// Accept only a strict "success".
104+
if (job.conclusion !== 'success') {
105+
failures.push(`${dep.label} (${job.name}) concluded ${job.conclusion}`);
106+
}
103107
}
104108
}
105109
}

0 commit comments

Comments
 (0)