fix(changelog): filter non-app releases

This commit is contained in:
t8y2
2026-07-24 09:55:48 +08:00
parent 1870be4a81
commit 562edef4dc
6 changed files with 110 additions and 6 deletions
+36 -1
View File
@@ -1,7 +1,7 @@
import assert from "node:assert/strict";
import test from "node:test";
import { buildLatestReleaseNotes } from "./sync-changelog.mjs";
import { buildLatestReleaseNotes, buildReleasesJson } from "./sync-changelog.mjs";
test("buildLatestReleaseNotes returns the curated latest release body", () => {
const result = buildLatestReleaseNotes([
@@ -26,3 +26,38 @@ test("buildLatestReleaseNotes returns the curated latest release body", () => {
notes: "### 新功能\n- new\n\n### 下载安装\n- assets",
});
});
test("changelog excludes agent and package release streams", () => {
const releases = [
{
tag_name: "packages-v0.4.42",
draft: false,
prerelease: false,
published_at: "2026-07-23T02:00:00Z",
body: "### Changed\n- packages",
},
{
tag_name: "agents-v0.2.64",
draft: false,
prerelease: false,
published_at: "2026-07-23T01:00:00Z",
body: "### Changed\n- agents",
},
{
tag_name: "v0.5.66",
draft: false,
prerelease: false,
published_at: "2026-07-23T00:00:00Z",
body: "### Changed\n- app",
},
];
assert.deepEqual(
buildReleasesJson(releases, new Date("2026-07-24T00:00:00Z")).releases.map((release) => release.tag),
["v0.5.66"],
);
assert.deepEqual(buildLatestReleaseNotes(releases), {
version: "v0.5.66",
notes: "### Changed\n- app",
});
});