From 0b0cb5520d3bf0dc49e7c353df5062ff18ce521e Mon Sep 17 00:00:00 2001 From: Tingluo Huang Date: Fri, 6 Sep 2024 17:16:17 -0400 Subject: [PATCH] Add runner or worker to the useragent. (#3457) --- src/Runner.Common/HostContext.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Runner.Common/HostContext.cs b/src/Runner.Common/HostContext.cs index 06b0cd589..46ea7042d 100644 --- a/src/Runner.Common/HostContext.cs +++ b/src/Runner.Common/HostContext.cs @@ -248,6 +248,7 @@ namespace GitHub.Runner.Common var currentProcess = Process.GetCurrentProcess(); _userAgents.Add(new ProductInfoHeaderValue("Pid", currentProcess.Id.ToString())); _userAgents.Add(new ProductInfoHeaderValue("CreationTime", Uri.EscapeDataString(DateTime.UtcNow.ToString("O")))); + _userAgents.Add(new ProductInfoHeaderValue($"({hostType})")); } public string GetDirectory(WellKnownDirectory directory)