Files
create-github-app-token/post.js
Parker Brown e715b04a11 feat: add proxy support via child process spawning
When proxy environment variables (https_proxy, HTTPS_PROXY, http_proxy,
HTTP_PROXY) are detected and NODE_USE_ENV_PROXY is not already set to
"1", the action spawns a child process with NODE_USE_ENV_PROXY=1 to
enable Node.js native proxy support.

- Add lib/run-with-proxy.js shared utility for both main.js and post.js
- Update main.js and post.js to use runWithProxy() wrapper
- Add tests for proxy spawning, child error handling, and already-enabled path
- 100% code coverage maintained

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-12 20:33:29 -07:00

17 lines
402 B
JavaScript

// @ts-check
import core from "@actions/core";
import { post } from "./lib/post.js";
import request from "./lib/request.js";
import { runWithProxy } from "./lib/run-with-proxy.js";
// Export promise for testing
export default runWithProxy(async () => {
return post(core, request).catch((error) => {
/* c8 ignore next 3 */
console.error(error);
core.setFailed(error.message);
});
});