mirror of
https://github.com/actions/runner.git
synced 2025-12-11 21:06:55 +00:00
Compare commits
3 Commits
CodeCleanu
...
DontAddTem
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
302aad97c5 | ||
|
|
17975e3491 | ||
|
|
e1e7fde7bc |
@@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/runtime-deps:6.0 as build
|
|||||||
|
|
||||||
ARG RUNNER_VERSION
|
ARG RUNNER_VERSION
|
||||||
ARG RUNNER_ARCH="x64"
|
ARG RUNNER_ARCH="x64"
|
||||||
ARG RUNNER_CONTAINER_HOOKS_VERSION=0.3.2
|
ARG RUNNER_CONTAINER_HOOKS_VERSION=0.3.1
|
||||||
ARG DOCKER_VERSION=20.10.23
|
ARG DOCKER_VERSION=20.10.23
|
||||||
|
|
||||||
RUN apt update -y && apt install curl unzip -y
|
RUN apt update -y && apt install curl unzip -y
|
||||||
|
|||||||
@@ -818,7 +818,6 @@ namespace GitHub.Runner.Common
|
|||||||
|
|
||||||
return mergedRecords;
|
return mergedRecords;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task UploadFile(UploadFileInfo file)
|
private async Task UploadFile(UploadFileInfo file)
|
||||||
{
|
{
|
||||||
bool uploadSucceed = false;
|
bool uploadSucceed = false;
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ namespace GitHub.Runner.Listener.Configuration
|
|||||||
GitHubAuthResult authResult = await GetTenantCredential(inputUrl, registerToken, Constants.RunnerEvent.Register);
|
GitHubAuthResult authResult = await GetTenantCredential(inputUrl, registerToken, Constants.RunnerEvent.Register);
|
||||||
runnerSettings.ServerUrl = authResult.TenantUrl;
|
runnerSettings.ServerUrl = authResult.TenantUrl;
|
||||||
runnerSettings.UseV2Flow = authResult.UseV2Flow;
|
runnerSettings.UseV2Flow = authResult.UseV2Flow;
|
||||||
Trace.Info($"Using V2 flow: {runnerSettings.UseV2Flow}");
|
_term.WriteLine($"Using V2 flow: {runnerSettings.UseV2Flow}");
|
||||||
creds = authResult.ToVssCredentials();
|
creds = authResult.ToVssCredentials();
|
||||||
Trace.Info("cred retrieved via GitHub auth");
|
Trace.Info("cred retrieved via GitHub auth");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ namespace GitHub.Runner.Worker.Container.ContainerHooks
|
|||||||
public HookContainer(ContainerInfo container)
|
public HookContainer(ContainerInfo container)
|
||||||
{
|
{
|
||||||
Image = container.ContainerImage;
|
Image = container.ContainerImage;
|
||||||
EntryPointArgs = container.ContainerEntryPointArgs?.Split(' ').Select(arg => arg.Trim()).Where(arg => !string.IsNullOrEmpty(arg)) ?? new List<string>();
|
EntryPointArgs = container.ContainerEntryPointArgs?.Split(' ').Select(arg => arg.Trim()) ?? new List<string>();
|
||||||
EntryPoint = container.ContainerEntryPoint;
|
EntryPoint = container.ContainerEntryPoint;
|
||||||
WorkingDirectory = container.ContainerWorkDirectory;
|
WorkingDirectory = container.ContainerWorkDirectory;
|
||||||
CreateOptions = container.ContainerCreateOptions;
|
CreateOptions = container.ContainerCreateOptions;
|
||||||
|
|||||||
@@ -150,11 +150,6 @@ namespace GitHub.Runner.Worker
|
|||||||
_runnerSettings = HostContext.GetService<IConfigurationStore>().GetSettings();
|
_runnerSettings = HostContext.GetService<IConfigurationStore>().GetSettings();
|
||||||
jobContext.SetRunnerContext("name", _runnerSettings.AgentName);
|
jobContext.SetRunnerContext("name", _runnerSettings.AgentName);
|
||||||
|
|
||||||
if (jobContext.Global.Variables.TryGetValue(WellKnownDistributedTaskVariables.RunnerEnvironment, out var runnerEnvironment))
|
|
||||||
{
|
|
||||||
jobContext.SetRunnerContext("environment", runnerEnvironment);
|
|
||||||
}
|
|
||||||
|
|
||||||
string toolsDirectory = HostContext.GetDirectory(WellKnownDirectory.Tools);
|
string toolsDirectory = HostContext.GetDirectory(WellKnownDirectory.Tools);
|
||||||
Directory.CreateDirectory(toolsDirectory);
|
Directory.CreateDirectory(toolsDirectory);
|
||||||
jobContext.SetRunnerContext("tool_cache", toolsDirectory);
|
jobContext.SetRunnerContext("tool_cache", toolsDirectory);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -163,7 +163,6 @@ namespace GitHub.DistributedTask.ObjectTemplating
|
|||||||
message = $"{prefix} {message}";
|
message = $"{prefix} {message}";
|
||||||
}
|
}
|
||||||
|
|
||||||
Errors.Add(message);
|
|
||||||
TraceWriter.Error(message);
|
TraceWriter.Error(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace GitHub.DistributedTask.WebApi
|
namespace GitHub.DistributedTask.WebApi
|
||||||
{
|
{
|
||||||
@@ -6,6 +6,5 @@ namespace GitHub.DistributedTask.WebApi
|
|||||||
{
|
{
|
||||||
public static readonly String JobId = "system.jobId";
|
public static readonly String JobId = "system.jobId";
|
||||||
public static readonly String RunnerLowDiskspaceThreshold = "system.runner.lowdiskspacethreshold";
|
public static readonly String RunnerLowDiskspaceThreshold = "system.runner.lowdiskspacethreshold";
|
||||||
public static readonly String RunnerEnvironment = "system.runnerEnvironment";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,57 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using GitHub.DistributedTask.ObjectTemplating.Tokens;
|
|
||||||
using Xunit;
|
|
||||||
|
|
||||||
namespace GitHub.DistributedTask.ObjectTemplating.Tests
|
|
||||||
{
|
|
||||||
public sealed class TemplateContextL0
|
|
||||||
{
|
|
||||||
[Fact]
|
|
||||||
[Trait("Level", "L0")]
|
|
||||||
[Trait("Category", "Common")]
|
|
||||||
public void VerifyError()
|
|
||||||
{
|
|
||||||
TemplateContext context = buildContext();
|
|
||||||
TemplateToken value = new StringToken(1, 1, 1, "some-token");
|
|
||||||
System.Exception ex = new System.Exception();
|
|
||||||
|
|
||||||
List<TemplateValidationError> expectedErrors = new();
|
|
||||||
expectedErrors.Add(new TemplateValidationError("(Line: 1, Col: 1): Exception of type 'System.Exception' was thrown."));
|
|
||||||
|
|
||||||
context.Error(value, ex);
|
|
||||||
|
|
||||||
|
|
||||||
Assert.True(expectedErrors.SequenceEqual(toList(context.Errors.GetEnumerator())));
|
|
||||||
|
|
||||||
|
|
||||||
Assert.True(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
private TemplateContext buildContext()
|
|
||||||
{
|
|
||||||
return new TemplateContext
|
|
||||||
{
|
|
||||||
// CancellationToken = CancellationToken.None,
|
|
||||||
Errors = new TemplateValidationErrors(10, int.MaxValue), // Don't truncate error messages otherwise we might not scrub secrets correctly
|
|
||||||
Memory = new TemplateMemory(
|
|
||||||
maxDepth: 100,
|
|
||||||
maxEvents: 1000000,
|
|
||||||
maxBytes: 10 * 1024 * 1024),
|
|
||||||
Schema = null,
|
|
||||||
TraceWriter = new EmptyTraceWriter(),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<TemplateValidationError> toList(IEnumerator<TemplateValidationError> enumerator)
|
|
||||||
{
|
|
||||||
List<TemplateValidationError> result = new();
|
|
||||||
while (enumerator.MoveNext())
|
|
||||||
{
|
|
||||||
TemplateValidationError err = enumerator.Current;
|
|
||||||
result.Add(err);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user