From 3e1dcc2c3bbda6307fc8f8fe1cc2576b9a061bb4 Mon Sep 17 00:00:00 2001 From: meh Date: Mon, 31 Aug 2026 16:27:10 +0700 Subject: [PATCH] fix(ci): exit rather than return in the release decider `node -e` has no CommonJS module wrapper, so a top-level `return` is a SyntaxError and the decide job died before it chose anything. The tag and dispatch branches both ended in one, which is why the first push to master under the new workflow failed instead of publishing nothing. `process.exit(0)` is what the surrounding code already reaches for on the error paths, and `emit` writes synchronously, so the outputs are on disk before the exit. The mistake was in how this was checked, not only in the code: the script was extracted to a .cjs file and run, and CommonJS wraps a module in a function, which makes a top-level return legal. Verifying it now means running the `run:` block as bash, the way the runner does. --- .github/workflows/release-js.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-js.yml b/.github/workflows/release-js.yml index e8d3cf9..3d1a2b0 100644 --- a/.github/workflows/release-js.yml +++ b/.github/workflows/release-js.yml @@ -84,7 +84,7 @@ jobs: process.exit(1); } emit([{ ...match, version }], true); - return; + process.exit(0); } if (process.env.GITHUB_EVENT_NAME === "workflow_dispatch") { @@ -94,7 +94,7 @@ jobs: process.exit(1); } emit([{ ...match, version: versionOf(match) }], false); - return; + process.exit(0); } // npm is the source of truth rather than the diff, so a rerun or a