Make migration verification CI-safe

This commit is contained in:
chuan
2026-05-18 01:21:41 +08:00
Unverified
parent 1adcadcc39
commit c0fd79dca8
+14 -5
View File
@@ -8,9 +8,6 @@ const themeSourceDir = join(root, "themes", "github-light");
const darkThemeSourceDir = join(root, "themes", "github-dark");
const tokenSourceDir = join(root, "styles", "tokens");
const packageJson = JSON.parse(await readFile(join(root, "package.json"), "utf8")) as { version?: string };
const githubThemePackageJson = JSON.parse(
await readFile(join(root, ".github-theme", "package.json"), "utf8"),
) as { version?: string };
const generated = await readFile(generatedPath, "utf8");
const generatedDark = await readFile(generatedDarkPath, "utf8");
@@ -39,8 +36,20 @@ if (packageJson.version !== "1.26.1") {
throw new Error(`project version must be 1.26.1, got ${packageJson.version}`);
}
if (githubThemePackageJson.version !== "1.26.1") {
throw new Error(`.github-theme version must be 1.26.1, got ${githubThemePackageJson.version}`);
try {
const githubThemePackageJson = JSON.parse(
await readFile(join(root, ".github-theme", "package.json"), "utf8"),
) as { version?: string };
if (githubThemePackageJson.version !== "1.26.1") {
throw new Error(`.github-theme version must be 1.26.1, got ${githubThemePackageJson.version}`);
}
} catch (error) {
const code = error instanceof Error && "code" in error ? error.code : undefined;
if (code !== "ENOENT") {
throw error;
}
}
await access(join(root, "themes", "index.ts"));