From c241b48ac6c32805a2662b0de1698303cd64742f Mon Sep 17 00:00:00 2001 From: Nikola Jokic Date: Fri, 8 Dec 2023 13:45:28 +0100 Subject: [PATCH] Update user agent for new ghalistener --- cmd/ghalistener/config/config.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmd/ghalistener/config/config.go b/cmd/ghalistener/config/config.go index cc22983820..127a57e755 100644 --- a/cmd/ghalistener/config/config.go +++ b/cmd/ghalistener/config/config.go @@ -10,6 +10,7 @@ import ( "github.com/actions/actions-runner-controller/github/actions" "github.com/actions/actions-runner-controller/logging" "github.com/go-logr/logr" + "golang.org/x/net/http/httpproxy" ) type Config struct { @@ -101,7 +102,6 @@ func (c *Config) Logger() (logr.Logger, error) { } func (c *Config) ActionsClient(logger logr.Logger) (*actions.Client, error) { - var creds actions.ActionsAuth switch c.Token { case "": @@ -141,7 +141,14 @@ func (c *Config) ActionsClient(logger logr.Logger) (*actions.Client, error) { Version: build.Version, CommitSHA: build.CommitSHA, ScaleSetID: c.RunnerScaleSetId, + HasProxy: hasProxy(), + Subsystem: "ghalistener", }) return client, nil } + +func hasProxy() bool { + proxyFunc := httpproxy.FromEnvironment().ProxyFunc() + return proxyFunc != nil +}