From 0fc4c0770e7c2eb9c367883b05003891b6180d43 Mon Sep 17 00:00:00 2001 From: garrytan Date: Tue, 3 Nov 2026 09:10:56 +0000 Subject: [PATCH] test(release-gate-workflow): run policy steps with Git Bash argument conversion off, as on the Linux runners (windows-scoped-shard) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- test/release-gate-workflow.test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/release-gate-workflow.test.ts b/test/release-gate-workflow.test.ts index cc94e9f62..cc8ce50e9 100644 --- a/test/release-gate-workflow.test.ts +++ b/test/release-gate-workflow.test.ts @@ -26,7 +26,10 @@ const scratch: string[] = []; afterAll(() => { for (const d of scratch) fs.rmSync(d, { recursive: true, force: true }); }); const GIT_ENV = { GIT_AUTHOR_NAME: 't', GIT_AUTHOR_EMAIL: 't@x', GIT_COMMITTER_NAME: 't', GIT_COMMITTER_EMAIL: 't@x' }; -/** Run a policy step's script in a scratch repo whose one commit holds this policy; returns its GITHUB_OUTPUT lines as an object. */ +/** + * Run a policy step's script in a scratch repo whose one commit holds this policy; returns its GITHUB_OUTPUT lines as an object. + * Git Bash's argument conversion is off, as on the Linux runners these steps run on: it rewrites `origin/main:.gstack/…` into a path list. + */ function runStep(step: Step, policy: unknown): Record { const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'release-gate-wf-')); scratch.push(dir); @@ -44,7 +47,7 @@ function runStep(step: Step, policy: unknown): Record { const out = path.join(dir, 'out'); const r = spawnSync('bash', ['-e', '-c', step.run!], { cwd: dir, encoding: 'utf8', timeout: 30_000, - env: { ...process.env, GITHUB_OUTPUT: out, GITHUB_STEP_SUMMARY: path.join(dir, 'summary'), GITHUB_SHA: sha, BASE_SHA: '', DEFAULT_BRANCH: 'main' }, + env: { ...process.env, MSYS_NO_PATHCONV: '1', MSYS2_ARG_CONV_EXCL: '*', GITHUB_OUTPUT: out, GITHUB_STEP_SUMMARY: path.join(dir, 'summary'), GITHUB_SHA: sha, BASE_SHA: '', DEFAULT_BRANCH: 'main' }, }); expect(r.status, r.stderr).toBe(0); const lines = (fs.existsSync(out) ? fs.readFileSync(out, 'utf8') : '').split('\n').filter(Boolean);