Skip to content

Commit 209aa22

Browse files
authored
Update changelog-pr.yml
1 parent dd8db43 commit 209aa22

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

.github/workflows/changelog-pr.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ jobs:
5656
const fileContent = await fs.readFile(configPath, 'utf-8');
5757
let changelogConfig = JSON.parse(fileContent);
5858
59-
// Reihenfolge der Kategorien beibehalten
6059
const order = [
6160
"💥 Breaking Changes",
6261
"🆕 New Scripts",
@@ -87,7 +86,7 @@ jobs:
8786
});
8887
8988
if (!pulls || pulls.length === 0) {
90-
console.log("⚠️ No merged PRs found. create empty Changelog.");
89+
console.log("⚠️ No merged PRs found. Generating empty changelog.");
9190
core.setOutput("result", JSON.stringify([]));
9291
return;
9392
}
@@ -101,7 +100,6 @@ jobs:
101100
const prBody = pr.body ? pr.body.toLowerCase() : "";
102101
const prNote = `- ${pr.title} [@${pr.user.login}](https://github.com/${pr.user.login}) ([#${pr.number}](${pr.html_url}))`;
103102
104-
// Mapping für PR-Checkboxen → Labels
105103
const templateLabelMappings = {
106104
"🐞 bug fix": "bugfix",
107105
"✨ new feature": "feature",
@@ -113,7 +111,7 @@ jobs:
113111
for (const [checkbox, label] of Object.entries(templateLabelMappings)) {
114112
const regex = new RegExp(`- \\[(.*?)\\] ${checkbox}`, "i");
115113
const match = prBody.match(regex);
116-
if (match && match[1].trim() !== "") { // Checkbox ist gesetzt
114+
if (match && match[1].trim() !== "") {
117115
prLabels.push(label);
118116
addedByTemplate = true;
119117
}
@@ -141,11 +139,12 @@ jobs:
141139
}
142140
143141
if (addedByTemplate) {
144-
console.log(`PR #${pr.number} added by PR-Template category`);
142+
console.log(`PR #${pr.number} categorized via PR template selection.`);
145143
}
146144
});
147145
148-
core.setOutput("result", JSON.stringify(categorizedPRs));
146+
core.setOutput("result", JSON.stringify(categorizedPRs.length ? categorizedPRs : []));
147+
149148
150149
- name: Update CHANGELOG.md
151150
uses: actions/github-script@v7

0 commit comments

Comments
 (0)