mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-28 22:48:20 +00:00
chore: improve changelog generator
This commit is contained in:
@@ -42,7 +42,7 @@ for (const changelog of changelogs) {
|
||||
} else if (line.startsWith('* **ignore:**')) {
|
||||
continue;
|
||||
} else if (changeMatch) {
|
||||
const localContext = changeMatch[2] ? changeMatch[2] : context;
|
||||
let localContext = changeMatch[2] ? changeMatch[2] : context;
|
||||
if (!changes[localContext]) throw new Error(`Unknown context: ${localContext}`);
|
||||
|
||||
let user = execSync(`curl -s https://api.github.com/repos/${changelog.project}/commits/${changeMatch[5]} | jq -r '.author.login'`).toString().trim();
|
||||
@@ -72,7 +72,10 @@ for (const changelog of changelogs) {
|
||||
|
||||
let issue = changeMatch[4].trim();
|
||||
if (issue && !issue.startsWith('[#')) issue = `[#${issue.split('/').pop()}](${issue})`;
|
||||
if (!issue) issue = '_NO_ISSUE_';
|
||||
if (!issue) {
|
||||
issue = '_NO_ISSUE_';
|
||||
localContext = 'error';
|
||||
}
|
||||
|
||||
messages.forEach((m) => changes[localContext].push(`- ${issue} ${m} (@${user})`));
|
||||
} else if (line === '# Changelog' || !line) {
|
||||
|
||||
Reference in New Issue
Block a user