mirror of
https://github.com/actions/runner.git
synced 2025-12-11 21:06:55 +00:00
Add name to runner context (#1312)
* Add generateIdTokenUrl as an env var * Add generateIdTokenUrl to env vars * Add name and runner_group to context * No longer add runner-group * Update runner name if needed * Get interface instead of concrete class * Check for nulls on ReservedAgent * Avoid loading setting file unnecesseraly * Only check agentName once * Use Trace.Error when can't update settings * Better equals and exception handling * Update JobDispatcher.cs * Add tests and null check
This commit is contained in:
@@ -106,6 +106,9 @@ namespace GitHub.Runner.Worker
|
||||
|
||||
jobContext.SetRunnerContext("os", VarUtil.OS);
|
||||
|
||||
var runnerSettings = HostContext.GetService<IConfigurationStore>().GetSettings();
|
||||
jobContext.SetRunnerContext("name", runnerSettings.AgentName);
|
||||
|
||||
string toolsDirectory = HostContext.GetDirectory(WellKnownDirectory.Tools);
|
||||
Directory.CreateDirectory(toolsDirectory);
|
||||
jobContext.SetRunnerContext("tool_cache", toolsDirectory);
|
||||
|
||||
Reference in New Issue
Block a user