diff --git a/action.yml b/action.yml index 2461e2a..2b5d045 100644 --- a/action.yml +++ b/action.yml @@ -133,5 +133,5 @@ outputs: description: "GitHub App slug" runs: using: "node24" - main: "dist/main.cjs" + main: "dist/bootstrap.cjs" post: "dist/post.cjs" diff --git a/bootstrap.js b/bootstrap.js new file mode 100644 index 0000000..845c7a3 --- /dev/null +++ b/bootstrap.js @@ -0,0 +1,7 @@ +// Enable env-based proxy support (honors explicit opt-out if caller set NODE_USE_ENV_PROXY) +if (process.env.NODE_USE_ENV_PROXY == null) { + process.env.NODE_USE_ENV_PROXY = "1"; +} + +// Defer to original main entry (dynamic import ensures above code runs first) +await import("./main.js"); diff --git a/main.js b/main.js index bc11c6d..094abed 100644 --- a/main.js +++ b/main.js @@ -1,6 +1,4 @@ // @ts-check -process.env.NODE_USE_ENV_PROXY = "1"; - import core from "@actions/core"; import { createAppAuth } from "@octokit/auth-app"; diff --git a/package.json b/package.json index a2e5ffa..2123f18 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "node": ">=24.4.0" }, "scripts": { - "build": "esbuild main.js post.js --bundle --outdir=dist --out-extension:.js=.cjs --platform=node --packages=bundle", + "build": "esbuild bootstrap.js main.js post.js --bundle --outdir=dist --out-extension:.js=.cjs --platform=node --packages=bundle", "test": "c8 --100 ava tests/index.js", "coverage": "c8 report --reporter html", "postcoverage": "open-cli coverage/index.html"