Add pid to user-agent and session owner. (#3432)

This commit is contained in:
Tingluo Huang
2024-08-16 15:17:13 -04:00
committed by GitHub
parent a77fe8a53f
commit 2979fbad94
4 changed files with 9 additions and 3 deletions

View File

@@ -88,7 +88,8 @@ namespace GitHub.Runner.Listener
Version = BuildConstants.RunnerPackage.Version,
OSDescription = RuntimeInformation.OSDescription,
};
string sessionName = $"{Environment.MachineName ?? "RUNNER"}";
var currentProcess = Process.GetCurrentProcess();
string sessionName = $"{Environment.MachineName ?? "RUNNER"} (PID: {currentProcess.Id})";
var taskAgentSession = new TaskAgentSession(sessionName, agent);
string errorMessage = string.Empty;