fix: bundle as CJS to support @actions/* packages

The @actions/* packages use CJS require() for Node.js builtins,
which fails with "Dynamic require of 'os' is not supported" when
bundled as ESM. Switch esbuild output to CJS format.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Zoltan Kochan
2026-03-16 01:54:09 +01:00
parent dc312cdfd7
commit ab0b84aeb1
2 changed files with 142 additions and 142 deletions

282
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -3,7 +3,7 @@
"type": "module",
"packageManager": "pnpm@10.32.1",
"scripts": {
"build:bundle": "esbuild src/index.ts --bundle --platform=node --target=node24 --format=esm --minify --outfile=dist/index.js --loader:.json=json",
"build:bundle": "esbuild src/index.ts --bundle --platform=node --target=node24 --format=cjs --minify --outfile=dist/index.js --loader:.json=json",
"build": "pnpm run build:bundle",
"start": "pnpm run build && sh ./run.sh"
},