From 1c3ff34d752f976920775dc2aca3277c8262f628 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 19 May 2026 00:28:44 +0100 Subject: [PATCH] ci(release): stabilize beta validation assertions --- src/infra/npm-install-env.test.ts | 6 +++++- test/scripts/test-install-sh-docker.test.ts | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/infra/npm-install-env.test.ts b/src/infra/npm-install-env.test.ts index 5c3b0b543cf..afdf1b5cb89 100644 --- a/src/infra/npm-install-env.test.ts +++ b/src/infra/npm-install-env.test.ts @@ -37,6 +37,10 @@ function expectZeroNpmJsonConfig(value: unknown): void { expect(value === 0 || value === "0").toBe(true); } +function expectUnsetOrZeroNpmJsonConfig(value: unknown): void { + expect(value == null || value === false || value === 0 || value === "0").toBe(true); +} + describe("npm project install env", () => { it("uses an absolute POSIX script shell for npm lifecycle scripts", () => { withMockedPlatform("linux", () => { @@ -376,7 +380,7 @@ describe("npm project install env", () => { npmConfig.before === false || typeof npmConfig.before === "string", ).toBe(true); - expectZeroNpmJsonConfig(npmConfig["min-release-age"]); + expectUnsetOrZeroNpmJsonConfig(npmConfig["min-release-age"]); } finally { fsSync.rmSync(dir, { recursive: true, force: true }); } diff --git a/test/scripts/test-install-sh-docker.test.ts b/test/scripts/test-install-sh-docker.test.ts index a82e1ac7b3f..cbf8d000b1d 100644 --- a/test/scripts/test-install-sh-docker.test.ts +++ b/test/scripts/test-install-sh-docker.test.ts @@ -98,10 +98,15 @@ describe("test-install-sh-docker", () => { it("allows repository branch history and release tags for secret-backed Docker release checks", () => { const workflow = readFileSync(LIVE_E2E_WORKFLOW_PATH, "utf8"); - expect(workflow).toContain("git fetch --no-tags origin '+refs/heads/*:refs/remotes/origin/*'"); expect(workflow).toContain('git rev-parse --verify "${INPUT_REF}^{commit}"'); + expect(workflow).toContain( + 'git merge-base --is-ancestor "$selected_sha" refs/remotes/origin/main', + ); expect(workflow).toContain("repository-branch-history"); expect(workflow).toContain("git tag --points-at \"$selected_sha\" | grep -Eq '^v'"); + expect(workflow).toContain( + "git for-each-ref --format='%(refname:short)' --contains \"$selected_sha\" refs/remotes/origin", + ); expect(workflow).toContain("reachable from an OpenClaw branch or release tag"); });