Add invalid/wontdo check

This commit is contained in:
CanbiZ 2025-01-09 23:05:53 +01:00 committed by GitHub
parent baa578c20a
commit be1821b16f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -70,25 +70,23 @@ jobs:
per_page: 100, per_page: 100,
}); });
const excludedLabels = ["invalid", "wontdo", process.env.AUTOMATED_PR_LABEL]; pulls.filter((pr) =>
pr.merged_at &&
new Date(pr.merged_at) > latestDateInChangelog &&
!pr.labels.some((label) => ["invalid", "wontdo", process.env.AUTOMATED_PR_LABEL].includes(label.name.toLowerCase()))
).forEach((pr) => {
const prLabels = pr.labels.map((label) => label.name.toLowerCase());
const prNote = `- ${pr.title} [@${pr.user.login}](https://github.com/${pr.user.login}) ([#${pr.number}](${pr.html_url}))`;
pulls.filter((pr) => for (const { labels, notes } of categorizedPRs) {
pr.merged_at && const prHasCategoryLabel = labels.some((label) => prLabels.includes(label));
new Date(pr.merged_at) > latestDateInChangelog && const isUnlabelledCategory = labels.length === 0;
!pr.labels.some((label) => excludedLabels.includes(label.name.toLowerCase())) if (prHasCategoryLabel || isUnlabelledCategory) {
).forEach((pr) => { notes.push(prNote);
const prLabels = pr.labels.map((label) => label.name.toLowerCase()); break;
const prNote = `- ${pr.title} [@${pr.user.login}](https://github.com/${pr.user.login}) ([#${pr.number}](${pr.html_url}))`; }
}
for (const { labels, notes } of categorizedPRs) { });
const prHasCategoryLabel = labels.some((label) => prLabels.includes(label));
const isUnlabelledCategory = labels.length === 0;
if (prHasCategoryLabel || isUnlabelledCategory) {
notes.push(prNote);
break;
}
}
});
return categorizedPRs; return categorizedPRs;