Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

fix(automations): make `!reportData.length` guard work correctly for last_week_tonight (#5575)

Copilotb4e849f223cf
diff --git a/automations/js/src/last_week_tonight.mjs b/automations/js/src/last_week_tonight.mjs
index c41439f81..32227cbfc 100644
--- a/automations/js/src/last_week_tonight.mjs
+++ b/automations/js/src/last_week_tonight.mjs
@@ -173,14 +173,17 @@ const postActivities = (activities) => {
}
// Entry point
+const hasStackLabel = (item) =>
+ item.labels.some((label) => label.name.startsWith("🧱 stack"))
+
const reportData = []
for (const repo of repos) {
const closedIssues = (
await octokit.rest.search.issuesAndPullRequests({ q: closedIssuesQ(repo) })
- ).data.items
+ ).data.items.filter(hasStackLabel)
const mergedPrs = (
await octokit.rest.search.issuesAndPullRequests({ q: mergedPrsQ(repo) })
- ).data.items
+ ).data.items.filter(hasStackLabel)
if (closedIssues.length || mergedPrs.length)
reportData.push({ repo, closedIssues, mergedPrs })
}