Compare commits

...

10 Commits

Author SHA1 Message Date
Parker Brown 0fde60e111 Simplify proxy environment setup in request.js
Removed undici proxy agent configuration and related error handling. Now only sets NODE_USE_ENV_PROXY to encourage Node to honor standard proxy environment variables.
2025-08-22 13:50:04 -07:00
Parker Brown 3ffe05f85c Support lowercase proxy environment variables
Adds detection for lowercase proxy environment variables (https_proxy, http_proxy) in addition to their uppercase counterparts when configuring the global dispatcher.
2025-08-22 13:46:06 -07:00
Parker Brown f57ea8787c Move proxy setup to request.js and update entrypoint
Proxy environment setup previously in bootstrap.js is now handled in lib/request.js for better encapsulation. The action entrypoint is updated from dist/bootstrap.cjs to dist/main.cjs, and bootstrap.js is removed. Build script is updated to exclude bootstrap.js.
2025-08-22 13:43:20 -07:00
Parker Brown 00ba6edc66 Switch build output to CommonJS (.cjs) format
Updated build script to output .cjs files instead of .js, and updated action.yml to reference the new .cjs files. Also clarified proxy environment variable handling in bootstrap.js for consistency.
2025-08-22 13:22:02 -07:00
Parker Brown 21c1159e4d Switch build output to ESM format and update entrypoints
Changed the build script to output ES modules instead of CommonJS. Updated action.yml to reference .js files instead of .cjs, and clarified proxy support logic in bootstrap.js.
2025-08-22 13:16:17 -07:00
Parker Brown 6423fe3683 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.
2025-08-22 13:10:57 -07:00
Parker Brown 39808af6a2 Move NODE_USE_ENV_PROXY assignment to top of file
Relocated the setting of process.env.NODE_USE_ENV_PROXY to the beginning of main.js for improved clarity and to ensure the environment variable is set before any imports or logic are executed.
2025-08-22 13:05:03 -07:00
Parker Brown fe4ba3360a Set NODE_USE_ENV_PROXY in main.js and update workflow
Moved NODE_USE_ENV_PROXY environment variable assignment from the GitHub Actions workflow to main.js for consistent runtime configuration. This change ensures the variable is always set when the application runs, regardless of workflow environment settings.
2025-08-22 12:31:42 -07:00
Parker Brown 926b8abad2 Set NODE_USE_ENV_PROXY in test workflow
Adds NODE_USE_ENV_PROXY=1 to the test job environment in GitHub Actions to enable proxy usage via environment variable.
2025-08-22 12:29:23 -07:00
Parker Brown d988c9aaad ci(test): set https_proxy env for test workflow
Adds the https_proxy environment variable to the test job in the GitHub Actions workflow to route requests through the specified proxy.
2025-08-22 12:24:32 -07:00
4 changed files with 11 additions and 3 deletions
+2
View File
@@ -44,6 +44,8 @@ jobs:
- run: npm run build
- uses: ./ # Uses the action in the root directory
id: test
env:
https_proxy: https://example.com
with:
app-id: ${{ vars.TEST_APP_ID }}
private-key: ${{ secrets.TEST_APP_PRIVATE_KEY }}
+7
View File
@@ -1,6 +1,13 @@
import core from "@actions/core";
import { request } from "@octokit/request";
/* c8 ignore start -- env knob setup */
// Encourage Node to honor standard *_PROXY vars for core HTTP(S) agents.
if (process.env.NODE_USE_ENV_PROXY == null) {
process.env.NODE_USE_ENV_PROXY = "1";
}
/* c8 ignore stop */
// Get the GitHub API URL from the action input and remove any trailing slash
const baseUrl = core.getInput("github-api-url").replace(/\/$/, "");
+1 -2
View File
@@ -1,5 +1,4 @@
// @ts-check
import core from "@actions/core";
import { createAppAuth } from "@octokit/auth-app";
@@ -38,7 +37,7 @@ export default main(
core,
createAppAuth,
request,
skipTokenRevoke,
skipTokenRevoke
).catch((error) => {
/* c8 ignore next 3 */
console.error(error);
+1 -1
View File
@@ -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 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"