Skip to content

Proxy environment variables are ignored by Octokit API requests #457

Description

@tcottin

Description

I tried using the action in a github enterprise environment.

Our runners need to go through a proxy to reach the GHES instances.
The runners are configured correctly to set the required http_proxy/https_proxy environment variables.

When the action is triggered I get the error:

Using JSON configuration from 'config' input.
(node:271) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for `url.parse()` vulnerabilities.
(Use `node --trace-deprecation ...` to show where the warning was created)
Warning: Failed to set reaction on comment ID 52435.
Command 'ping-local' to be dispatched.
Error: getaddrinfo ENOTFOUND <ghes-instance>.com

Expected Behaviour

When http_proxy/https_proxy are set, API requests should be sent through the configured proxy.

AI Assisted Analysis

With the help of AI I could figure out that in the autoProxyAgent function, the Octokit request is currently configured to use HttpProxyAgent.
But the current Octokit request stack uses Fetch-compatible requests and therefore the Node.js HTTP(S) agents are not used by the underlying transport.
AI suggested to configure Octokit with an Undici Fetch implementation using EnvHttpProxyAgent as its dispatcher.
This worked for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions