mirror of
https://github.com/actions/runner.git
synced 2025-12-12 05:37:01 +00:00
Resolve Actions Directly From Launch for Run Service Jobs (#2529)
Co-authored-by: Tingluo Huang <tingluohuang@github.com>
This commit is contained in:
@@ -58,6 +58,18 @@ namespace GitHub.Runner.Worker
|
||||
await runServer.ConnectAsync(systemConnection.Url, jobServerCredential);
|
||||
server = runServer;
|
||||
|
||||
message.Variables.TryGetValue("system.github.launch_endpoint", out VariableValue launchEndpointVariable);
|
||||
var launchReceiverEndpoint = launchEndpointVariable?.Value;
|
||||
|
||||
if (systemConnection?.Authorization != null &&
|
||||
systemConnection.Authorization.Parameters.TryGetValue("AccessToken", out var accessToken) &&
|
||||
!string.IsNullOrEmpty(accessToken) &&
|
||||
!string.IsNullOrEmpty(launchReceiverEndpoint))
|
||||
{
|
||||
Trace.Info("Initializing launch client");
|
||||
var launchServer = HostContext.GetService<ILaunchServer>();
|
||||
launchServer.InitializeLaunchClient(new Uri(launchReceiverEndpoint), accessToken);
|
||||
}
|
||||
_jobServerQueue = HostContext.GetService<IJobServerQueue>();
|
||||
_jobServerQueue.Start(message, resultServiceOnly: true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user