File tree Expand file tree Collapse file tree 1 file changed +19
-16
lines changed Expand file tree Collapse file tree 1 file changed +19
-16
lines changed Original file line number Diff line number Diff line change @@ -70,22 +70,25 @@ jobs:
7070 per_page: 100,
7171 });
7272
73- pulls.filter((pr) =>
74- pr.merged_at && new Date(pr.merged_at) > latestDateInChangelog
75- ).forEach((pr) => {
76- const prLabels = pr.labels.map((label) => label.name.toLowerCase());
77- const prNote = `- ${pr.title} [@${pr.user.login}](https://github.com/${pr.user.login}) ([#${pr.number}](${pr.html_url}))`;
78-
79- for (const { labels, notes } of categorizedPRs) {
80- const prHasCategoryLabel = labels.some((label) => prLabels.includes(label));
81- const isUnlabelledCategory = labels.length === 0;
82- const prShouldBeExcluded = prLabels.includes(process.env.AUTOMATED_PR_LABEL);
83- if ((prHasCategoryLabel || isUnlabelledCategory) && !prShouldBeExcluded) {
84- notes.push(prNote);
85- break;
86- }
87- };
88- });
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+ });
8992
9093 return categorizedPRs;
9194
You can’t perform that action at this time.
0 commit comments