Make migration verification CI-safe
This commit is contained in:
@@ -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"));
|
||||
|
||||
Reference in New Issue
Block a user