Add bootstrap entry for env-based proxy support
Introduces bootstrap.js to set NODE_USE_ENV_PROXY before loading main.js, ensuring proxy support is enabled unless explicitly opted out. Updates action.yml to use bootstrap as the main entry and modifies build script to bundle bootstrap.js.
This commit is contained in:
+1
-1
@@ -133,5 +133,5 @@ outputs:
|
||||
description: "GitHub App slug"
|
||||
runs:
|
||||
using: "node24"
|
||||
main: "dist/main.cjs"
|
||||
main: "dist/bootstrap.cjs"
|
||||
post: "dist/post.cjs"
|
||||
|
||||
Vendored
+7
@@ -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");
|
||||
@@ -1,6 +1,4 @@
|
||||
// @ts-check
|
||||
process.env.NODE_USE_ENV_PROXY = "1";
|
||||
|
||||
import core from "@actions/core";
|
||||
import { createAppAuth } from "@octokit/auth-app";
|
||||
|
||||
|
||||
+1
-1
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user