


















@@ -4,6 +4,7 @@ import { parse } from "yaml";
4455const PROOF_SCRIPT = "scripts/e2e/telegram-user-crabbox-proof.ts";
66const USER_DRIVER = "scripts/e2e/telegram-user-driver.py";
7+const PACKAGE_JSON = "package.json";
78const WORKFLOW = ".github/workflows/mantis-telegram-desktop-proof.yml";
89const LIVE_WORKFLOW = ".github/workflows/mantis-telegram-live.yml";
910@@ -23,6 +24,19 @@ type Workflow = {
2324jobs?: Record<string, WorkflowJob>;
2425};
252627+type PackageJson = {
28+packageManager?: string;
29+};
30+31+function repositoryPnpmVersion(): string {
32+const packageJson = JSON.parse(readFileSync(PACKAGE_JSON, "utf8")) as PackageJson;
33+const version = packageJson.packageManager?.match(/^pnpm@(.+)$/)?.[1];
34+if (!version) {
35+throw new Error(`Missing pnpm packageManager pin in ${PACKAGE_JSON}`);
36+}
37+return version.split("+", 1)[0];
38+}
39+2640function workflowStep(name: string): WorkflowStep {
2741const workflow = parse(readFileSync(WORKFLOW, "utf8")) as Workflow;
2842const steps = workflow.jobs?.run_telegram_desktop_proof?.steps ?? [];
@@ -34,12 +48,13 @@ function workflowStep(name: string): WorkflowStep {
3448}
35493650describe("Mantis Telegram Desktop proof workflow", () => {
37-it("runs with the repository pnpm major", () => {
51+it("uses the repository pnpm version pin", () => {
3852const workflow = parse(readFileSync(WORKFLOW, "utf8")) as Workflow;
3953const liveWorkflow = parse(readFileSync(LIVE_WORKFLOW, "utf8")) as Workflow;
54+const pnpmVersion = repositoryPnpmVersion();
405541-expect(workflow.env?.PNPM_VERSION).toBe("11.0.8");
42-expect(liveWorkflow.env?.PNPM_VERSION).toBe("11.0.8");
56+expect(workflow.env?.PNPM_VERSION).toBe(pnpmVersion);
57+expect(liveWorkflow.env?.PNPM_VERSION).toBe(pnpmVersion);
4358});
44594560it("uses the repo-owned Telegram user driver by default", () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。