GitHub API requests ignore proxy environment variables on GitHub Enterprise Server
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- github-actions, node.js, typescript
Direzione di ricerca
Start in src/client/github/client.ts and compare its Octokit setup with the proxy-aware configuration in @actions/github and the linked Octokit and Node.js documentation. Verify the chosen request.fetch or dispatcher approach handles the documented proxy variables, CONNECT requests, and proxy authentication where supported; done means GitHub API calls use the proxy and the reported self-hosted-runner scenario no longer times out.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
ctrf-io/github-test-reporter cannot post or update comments when the GitHub Enterprise Server API is accessible from the runner only through an HTTP forward proxy.
The proxy environment variables are configured, but the reporter appears to connect directly to the GitHub Enterprise Server host instead of using the proxy. Because direct access is blocked by the firewall, the connection times out.
This affects features that use the GitHub API, including pull request comments, issue comments, historical reports, and artifact retrieval.
Environment
- Action:
ctrf-io/github-test-reporter@v1 - GitHub platform: GitHub Enterprise Server
- Runner: self-hosted
- Action runtime: Node.js 24
- Target API:
https://github.example.com/api/v3 - Network: GitHub Enterprise Server is reachable from the runner only through an HTTP forward proxy
All company-specific hostnames, repository names, and proxy addresses in this report have been replaced with placeholders.
Proxy configuration
The standard proxy environment variables are configured for the action:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HTTP_PROXY: http://proxy.example.com:8080
HTTPS_PROXY: http://proxy.example.com:8080
http_proxy: http://proxy.example.com:8080
https_proxy: http://proxy.example.com:8080
A proxy-aware client such as curl can reach the same GitHub Enterprise API endpoint from the runner when configured to use this proxy.
Steps to reproduce
Run the reporter on a self-hosted runner where direct access to GitHub Enterprise Server is blocked, but access through an HTTP forward proxy is available:
- name: Publish test report
uses: ctrf-io/github-test-reporter@v1
if: always()
with:
report-path: path/to/ctrf-report.json
pull-request-report: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HTTP_PROXY: http://proxy.example.com:8080
HTTPS_PROXY: http://proxy.example.com:8080
http_proxy: http://proxy.example.com:8080
https_proxy: http://proxy.example.com:8080
Actual behavior
The request is retried three times and then fails with a connection timeout:
GET /repos/example-org/example-repo/issues/143/comments?per_page=100 - 500 with id UNKNOWN in 10598ms
GET /repos/example-org/example-repo/issues/143/comments?per_page=100 - 500 with id UNKNOWN in 10510ms
GET /repos/example-org/example-repo/issues/143/comments?per_page=100 - 500 with id UNKNOWN in 10545ms
GET /repos/example-org/example-repo/issues/143/comments?per_page=100 - 500 with id UNKNOWN in 10516ms
Warning: Failed to post PR comment: Connect Timeout Error
(attempted address: github.example.com:443, timeout: 10000ms)
The 500 with id UNKNOWN entries appear to be generated by Octokit's retry plugin for the connection failure. They do not appear to represent HTTP 500 responses returned by GitHub Enterprise Server, because the underlying error is a connection timeout.
The attempted address also indicates that the client is trying to connect directly to github.example.com:443.
Expected behavior
GitHub API requests made by the action should use the proxy configured through the standard environment variables:
HTTPS_PROXYorhttps_proxyHTTP_PROXYorhttp_proxyNO_PROXYorno_proxy
If additional configuration is required, it should be documented.
Suspected cause
The reporter creates its own @octokit/rest client here:
https://github.com/ctrf-io/github-test-reporter/blob/main/src/client/github/client.ts
The client currently configures authentication, the GitHub API base URL, and retries, but it does not provide a proxy-aware request.fetch implementation or dispatcher:
const options = {
auth: GITHUB_TOKEN,
retry: {
enabled: true,
retries: 3,
},
};
According to the Octokit documentation, its API client does not use standard proxy environment variables by default. A proxy-aware fetch implementation or dispatcher must be provided:
https://github.com/octokit/octokit.js#proxy-servers-nodejs-only
For comparison, @actions/github configures Octokit with proxy-aware request handling through @actions/http-client:
- https://github.com/actions/toolkit/blob/main/packages/github/src/utils.ts
- https://github.com/actions/toolkit/blob/main/packages/github/src/internal/utils.ts
The action currently declares a Node.js 24 runtime. Node.js 24 supports HTTP_PROXY, HTTPS_PROXY, and NO_PROXY, but environment-based proxy handling must be enabled with NODE_USE_ENV_PROXY=1, --use-env-proxy, or programmatically:
- https://nodejs.org/docs/latest-v24.x/api/cli.html#--use-env-proxy
- https://nodejs.org/docs/latest-v24.x/api/http.html#built-in-proxy-support
Setting only HTTP_PROXY or HTTPS_PROXY does not automatically enable proxy handling for Node.js fetch.
Suggested solution
Please make the GitHub API client proxy-aware. Possible approaches include:
- Use the proxy-aware Octokit configuration provided by
@actions/github. - Provide Octokit with a proxy-aware
request.fetchimplementation or Undici dispatcher. - Explicitly enable Node.js environment-proxy support before creating the Octokit client.
Ideally, the implementation should support:
HTTPS_PROXYandhttps_proxyHTTP_PROXYandhttp_proxyNO_PROXYandno_proxy- HTTPS destinations through an HTTP CONNECT proxy
- Proxy authentication, if supported
- Lingua principale
- TypeScript
- Stelle
- 376
- Fork
- 42
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ctrf-io/github-test-reporter
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
ctrf-io/github-test-reporter#309 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
ctrf-io/github-test-reporter#302 · 2 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
ctrf-io/github-test-reporter#297 · 1 commento ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 45/100
ctrf-io/github-test-reporter#282 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 45/100
ctrf-io/github-test-reporter#278 · 1 commento ·
Tutte le issue di ctrf-io/github-test-reporter
Issue simili
-
area/frontend good first issue kind/cooldown
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
voidzero-dev/oxc-angular-compiler#511 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
langchain-ai/deepagentsjs#898 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
anomalyco/models.dev#8509 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug documentation P2 UI/UX
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno