Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

GitHub API requests ignore proxy environment variables on GitHub Enterprise Server

クローズ
#331 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
github-actions, node.js, typescript
領域
api, ci-cd

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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_PROXY or https_proxy
  • HTTP_PROXY or http_proxy
  • NO_PROXY or no_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:

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:

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:

  1. Use the proxy-aware Octokit configuration provided by @actions/github.
  2. Provide Octokit with a proxy-aware request.fetch implementation or Undici dispatcher.
  3. Explicitly enable Node.js environment-proxy support before creating the Octokit client.

Ideally, the implementation should support:

  • HTTPS_PROXY and https_proxy
  • HTTP_PROXY and http_proxy
  • NO_PROXY and no_proxy
  • HTTPS destinations through an HTTP CONNECT proxy
  • Proxy authentication, if supported
主要言語
TypeScript
スター
378
フォーク
43
平均マージ
3日 11時間
マージ済み PR(30日)
2

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ctrf-io/github-test-reporter のほかの issue

ctrf-io/github-test-reporter の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。