Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix: bump blocksuite script changelog generate failed (#8708)

donteatfriedricec0d802a16946
diff --git a/tools/bump-blocksuite/index.js b/tools/bump-blocksuite/index.js
index a2916afbf8..88bd889cbd 100644
--- a/tools/bump-blocksuite/index.js
+++ b/tools/bump-blocksuite/index.js
@@ -25,6 +25,8 @@ const info = await fetch('https://registry.npmjs.org/@blocksuite/affine').then(
const latestVersion = info['dist-tags'].latest;
const latestHash = latestVersion.split('-').pop();
+const latestGitHead = info.versions[latestHash].gitHead;
+const oldGitHead = info.versions[oldHash].gitHead;
if (oldHash === latestHash) {
console.info(chalk.greenBright('Already updated'));
@@ -85,8 +87,6 @@ remote.fetch(
)
);
-const latest = repo.findCommit(latestHash);
-
const commits = {
Features: [],
Bugfix: [],
@@ -94,11 +94,17 @@ const commits = {
Misc: [],
};
+if (!latestGitHead) {
+ console.info('latestGitHead is not found');
+ console.info('Skip generating changelog');
+ process.exit(0);
+}
+
for (const oid of repo
.revWalk()
- .push(latest.id())
+ .push(latestGitHead)
.setSorting(Sort.Time & Sort.Topological)) {
- if (oid.startsWith(oldHash)) {
+ if (oid.startsWith(oldGitHead)) {
break;
}
const commit = repo.findCommit(oid);