Skip to content

Commit

Permalink
add invalid / wontdo check
Browse files Browse the repository at this point in the history
  • Loading branch information
MickLesk authored Jan 9, 2025
1 parent d8f433c commit baa578c
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions .github/workflows/changelog-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,25 @@ jobs:
per_page: 100,
});
pulls.filter((pr) =>
pr.merged_at && new Date(pr.merged_at) > latestDateInChangelog
).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}))`;
for (const { labels, notes } of categorizedPRs) {
const prHasCategoryLabel = labels.some((label) => prLabels.includes(label));
const isUnlabelledCategory = labels.length === 0;
const prShouldBeExcluded = prLabels.includes(process.env.AUTOMATED_PR_LABEL);
if ((prHasCategoryLabel || isUnlabelledCategory) && !prShouldBeExcluded) {
notes.push(prNote);
break;
}
};
});
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) => excludedLabels.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}))`;

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;

Expand Down

0 comments on commit baa578c

Please sign in to comment.