mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
ci: fix release notes generation (#8815)
This commit is contained in:
@@ -64,15 +64,18 @@ async function getChangeLog(repo, previousCommit, currentCommit) {
|
||||
|
||||
const revWalk = repo.revWalk();
|
||||
|
||||
let headId = repo.head().target();
|
||||
|
||||
if (currentCommit) {
|
||||
const commit =
|
||||
repo.findCommit(currentCommit) ?? findTagByName(repo, previousCommit);
|
||||
repo.findCommit(currentCommit) ?? findTagByName(repo, currentCommit);
|
||||
if (!commit) {
|
||||
console.log(
|
||||
`Current commit ${currentCommit} not found in ${repo.path()}`
|
||||
);
|
||||
return '';
|
||||
}
|
||||
headId = commit.id();
|
||||
revWalk.push(commit.id());
|
||||
} else {
|
||||
revWalk.pushHead();
|
||||
@@ -89,7 +92,7 @@ async function getChangeLog(repo, previousCommit, currentCommit) {
|
||||
email: commit.author().email(),
|
||||
},
|
||||
});
|
||||
if (commitId.startsWith(previousCommit)) {
|
||||
if (commitId === prevCommit.id()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -98,6 +101,9 @@ async function getChangeLog(repo, previousCommit, currentCommit) {
|
||||
token: process.env.GITHUB_TOKEN,
|
||||
});
|
||||
|
||||
parseConfig.from = prevCommit.id();
|
||||
parseConfig.to = headId;
|
||||
|
||||
const parsedCommits = parseCommits(commits, parseConfig);
|
||||
await resolveAuthors(parsedCommits, parseConfig);
|
||||
return generateMarkdown(parsedCommits, parseConfig)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
"dependencies": {
|
||||
"@napi-rs/simple-git": "^0.1.18",
|
||||
"@slack/web-api": "^7.3.4",
|
||||
"changelogithub": "^0.13.9",
|
||||
"jsx-slack": "^6.1.1",
|
||||
"changelogithub": "^0.13.11",
|
||||
"jsx-slack": "^6.1.2",
|
||||
"marked": "^15.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
Reference in New Issue
Block a user