fix: add commits directly pushed to master in changelog (#4798)
This commit is contained in:
parent
5c61613a2e
commit
d2fd7be457
@ -20,7 +20,7 @@ const headerForType = {
|
|||||||
perf: "Performance",
|
perf: "Performance",
|
||||||
build: "Build",
|
build: "Build",
|
||||||
};
|
};
|
||||||
|
const badCommits = [];
|
||||||
const getCommitHashForLastVersion = async () => {
|
const getCommitHashForLastVersion = async () => {
|
||||||
try {
|
try {
|
||||||
const commitMessage = `"release @excalidraw/excalidraw@${lastVersion}"`;
|
const commitMessage = `"release @excalidraw/excalidraw@${lastVersion}"`;
|
||||||
@ -53,19 +53,26 @@ const getLibraryCommitsSinceLastRelease = async () => {
|
|||||||
const messageWithoutType = commit.slice(indexOfColon + 1).trim();
|
const messageWithoutType = commit.slice(indexOfColon + 1).trim();
|
||||||
const messageWithCapitalizeFirst =
|
const messageWithCapitalizeFirst =
|
||||||
messageWithoutType.charAt(0).toUpperCase() + messageWithoutType.slice(1);
|
messageWithoutType.charAt(0).toUpperCase() + messageWithoutType.slice(1);
|
||||||
const prNumber = commit.match(/\(#([0-9]*)\)/)[1];
|
const prMatch = commit.match(/\(#([0-9]*)\)/);
|
||||||
|
if (prMatch) {
|
||||||
|
const prNumber = prMatch[1];
|
||||||
|
|
||||||
// return if the changelog already contains the pr number which would happen for package updates
|
// return if the changelog already contains the pr number which would happen for package updates
|
||||||
if (existingChangeLog.includes(prNumber)) {
|
if (existingChangeLog.includes(prNumber)) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
const prMarkdown = `[#${prNumber}](https://github.com/excalidraw/excalidraw/pull/${prNumber})`;
|
||||||
|
const messageWithPRLink = messageWithCapitalizeFirst.replace(
|
||||||
|
/\(#[0-9]*\)/,
|
||||||
|
prMarkdown,
|
||||||
|
);
|
||||||
|
commitList[type].push(messageWithPRLink);
|
||||||
|
} else {
|
||||||
|
badCommits.push(commit);
|
||||||
|
commitList[type].push(messageWithCapitalizeFirst);
|
||||||
}
|
}
|
||||||
const prMarkdown = `[#${prNumber}](https://github.com/excalidraw/excalidraw/pull/${prNumber})`;
|
|
||||||
const messageWithPRLink = messageWithCapitalizeFirst.replace(
|
|
||||||
/\(#[0-9]*\)/,
|
|
||||||
prMarkdown,
|
|
||||||
);
|
|
||||||
commitList[type].push(messageWithPRLink);
|
|
||||||
});
|
});
|
||||||
|
console.info("Bad commits:", badCommits);
|
||||||
return commitList;
|
return commitList;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user