Skip to content

Commit be1821b

Browse files
authored
Add invalid/wontdo check
1 parent baa578c commit be1821b

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

.github/workflows/changelog-pr.yml

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -70,25 +70,23 @@ jobs:
7070
per_page: 100,
7171
});
7272
73-
const excludedLabels = ["invalid", "wontdo", process.env.AUTOMATED_PR_LABEL];
74-
75-
pulls.filter((pr) =>
76-
pr.merged_at &&
77-
new Date(pr.merged_at) > latestDateInChangelog &&
78-
!pr.labels.some((label) => excludedLabels.includes(label.name.toLowerCase()))
79-
).forEach((pr) => {
80-
const prLabels = pr.labels.map((label) => label.name.toLowerCase());
81-
const prNote = `- ${pr.title} [@${pr.user.login}](https://github.com/${pr.user.login}) ([#${pr.number}](${pr.html_url}))`;
82-
83-
for (const { labels, notes } of categorizedPRs) {
84-
const prHasCategoryLabel = labels.some((label) => prLabels.includes(label));
85-
const isUnlabelledCategory = labels.length === 0;
86-
if (prHasCategoryLabel || isUnlabelledCategory) {
87-
notes.push(prNote);
88-
break;
89-
}
90-
}
91-
});
73+
pulls.filter((pr) =>
74+
pr.merged_at &&
75+
new Date(pr.merged_at) > latestDateInChangelog &&
76+
!pr.labels.some((label) => ["invalid", "wontdo", process.env.AUTOMATED_PR_LABEL].includes(label.name.toLowerCase()))
77+
).forEach((pr) => {
78+
const prLabels = pr.labels.map((label) => label.name.toLowerCase());
79+
const prNote = `- ${pr.title} [@${pr.user.login}](https://github.com/${pr.user.login}) ([#${pr.number}](${pr.html_url}))`;
80+
81+
for (const { labels, notes } of categorizedPRs) {
82+
const prHasCategoryLabel = labels.some((label) => prLabels.includes(label));
83+
const isUnlabelledCategory = labels.length === 0;
84+
if (prHasCategoryLabel || isUnlabelledCategory) {
85+
notes.push(prNote);
86+
break;
87+
}
88+
}
89+
});
9290
9391
return categorizedPRs;
9492

0 commit comments

Comments
 (0)