mirror of
https://github.com/actions/runner.git
synced 2025-12-11 21:06:55 +00:00
Compare commits
9 Commits
v2.295.0
...
docker-log
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f8d55dcb8 | ||
|
|
5e0c2ef816 | ||
|
|
95459dea5f | ||
|
|
59894790de | ||
|
|
cba19c4d7e | ||
|
|
01fd04464d | ||
|
|
1cb1779d6b | ||
|
|
42c86665a7 | ||
|
|
f9c2bf1dd7 |
@@ -1,11 +1,6 @@
|
|||||||
## Features
|
|
||||||
- GHES: Support connecting to GitHub Enterprise Server Actions Service on a subdomain
|
|
||||||
## Bugs
|
## Bugs
|
||||||
- Fixed a bug where GITHUB_ENV would not update correctly between composite action steps (#1794)
|
- Fixed an issue where job and service container envs were corrupted (#2091)
|
||||||
- Fixed runner update bug caused by `update.sh|cmd` running too long (#2044)
|
|
||||||
## Misc
|
## Misc
|
||||||
- Bump Newtonsoft.Json from 11.0.2 to 13.0.1 (#2012)
|
|
||||||
- Change a periodic token expiry log message level from `WARNING` to `VERBOSE` (#2021)
|
|
||||||
|
|
||||||
## Windows x64
|
## Windows x64
|
||||||
We recommend configuring the runner in a root folder of the Windows drive (e.g. "C:\actions-runner"). This will help avoid issues related to service identity folder permissions and long file path restrictions on Windows.
|
We recommend configuring the runner in a root folder of the Windows drive (e.g. "C:\actions-runner"). This will help avoid issues related to service identity folder permissions and long file path restrictions on Windows.
|
||||||
@@ -32,7 +27,7 @@ curl -O -L https://github.com/actions/runner/releases/download/v<RUNNER_VERSION>
|
|||||||
tar xzf ./actions-runner-osx-x64-<RUNNER_VERSION>.tar.gz
|
tar xzf ./actions-runner-osx-x64-<RUNNER_VERSION>.tar.gz
|
||||||
```
|
```
|
||||||
|
|
||||||
## [Pre-release] OSX arm64 (Apple silicon)
|
## OSX arm64 (Apple silicon)
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
# Create a folder
|
# Create a folder
|
||||||
|
|||||||
@@ -585,6 +585,8 @@ namespace GitHub.Runner.Worker
|
|||||||
|
|
||||||
public void ProcessCommand(IExecutionContext context, string inputLine, ActionCommand command, ContainerInfo container)
|
public void ProcessCommand(IExecutionContext context, string inputLine, ActionCommand command, ContainerInfo container)
|
||||||
{
|
{
|
||||||
|
ValidateLinesAndColumns(command, context);
|
||||||
|
|
||||||
command.Properties.TryGetValue(IssueCommandProperties.File, out string file);
|
command.Properties.TryGetValue(IssueCommandProperties.File, out string file);
|
||||||
command.Properties.TryGetValue(IssueCommandProperties.Line, out string line);
|
command.Properties.TryGetValue(IssueCommandProperties.Line, out string line);
|
||||||
command.Properties.TryGetValue(IssueCommandProperties.Column, out string column);
|
command.Properties.TryGetValue(IssueCommandProperties.Column, out string column);
|
||||||
|
|||||||
@@ -503,7 +503,7 @@ namespace GitHub.Runner.Worker
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new NotSupportedException(nameof(ConvertRuns));
|
throw new NotSupportedException("Missing 'using' value. 'using' requires 'composite', 'docker', 'node12' or 'node16'.");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ConvertInputs(
|
private void ConvertInputs(
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ namespace GitHub.Runner.Worker.Container
|
|||||||
public async Task<string> DockerCreate(IExecutionContext context, ContainerInfo container)
|
public async Task<string> DockerCreate(IExecutionContext context, ContainerInfo container)
|
||||||
{
|
{
|
||||||
IList<string> dockerOptions = new List<string>();
|
IList<string> dockerOptions = new List<string>();
|
||||||
|
IDictionary<string, string> environment = new Dictionary<string, string>();
|
||||||
// OPTIONS
|
// OPTIONS
|
||||||
dockerOptions.Add($"--name {container.ContainerDisplayName}");
|
dockerOptions.Add($"--name {container.ContainerDisplayName}");
|
||||||
dockerOptions.Add($"--label {DockerInstanceLabel}");
|
dockerOptions.Add($"--label {DockerInstanceLabel}");
|
||||||
@@ -131,11 +132,12 @@ namespace GitHub.Runner.Worker.Container
|
|||||||
{
|
{
|
||||||
if (String.IsNullOrEmpty(env.Value))
|
if (String.IsNullOrEmpty(env.Value))
|
||||||
{
|
{
|
||||||
dockerOptions.Add($"-e \"{env.Key}\"");
|
dockerOptions.Add(DockerUtil.CreateEscapedOption("-e", env.Key));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dockerOptions.Add($"-e \"{env.Key}={env.Value.Replace("\"", "\\\"")}\"");
|
environment.Add(env.Key, env.Value);
|
||||||
|
dockerOptions.Add(DockerUtil.CreateEscapedOption("-e", env.Key));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,7 +185,7 @@ namespace GitHub.Runner.Worker.Container
|
|||||||
dockerOptions.Add($"{container.ContainerEntryPointArgs}");
|
dockerOptions.Add($"{container.ContainerEntryPointArgs}");
|
||||||
|
|
||||||
var optionsString = string.Join(" ", dockerOptions);
|
var optionsString = string.Join(" ", dockerOptions);
|
||||||
List<string> outputStrings = await ExecuteDockerCommandAsync(context, "create", optionsString);
|
List<string> outputStrings = await ExecuteDockerCommandAsync(context, "create", optionsString, environment);
|
||||||
|
|
||||||
return outputStrings.FirstOrDefault();
|
return outputStrings.FirstOrDefault();
|
||||||
}
|
}
|
||||||
@@ -202,7 +204,7 @@ namespace GitHub.Runner.Worker.Container
|
|||||||
{
|
{
|
||||||
// e.g. -e MY_SECRET maps the value into the exec'ed process without exposing
|
// e.g. -e MY_SECRET maps the value into the exec'ed process without exposing
|
||||||
// the value directly in the command
|
// the value directly in the command
|
||||||
dockerOptions.Add($"-e {env.Key}");
|
dockerOptions.Add(DockerUtil.CreateEscapedOption("-e", env.Key));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Watermark for GitHub Action environment
|
// Watermark for GitHub Action environment
|
||||||
@@ -443,6 +445,11 @@ namespace GitHub.Runner.Worker.Container
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async Task<List<string>> ExecuteDockerCommandAsync(IExecutionContext context, string command, string options)
|
private async Task<List<string>> ExecuteDockerCommandAsync(IExecutionContext context, string command, string options)
|
||||||
|
{
|
||||||
|
return await ExecuteDockerCommandAsync(context, command, options, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task<List<string>> ExecuteDockerCommandAsync(IExecutionContext context, string command, string options, IDictionary<string, string> environment)
|
||||||
{
|
{
|
||||||
string arg = $"{command} {options}".Trim();
|
string arg = $"{command} {options}".Trim();
|
||||||
context.Command($"{DockerPath} {arg}");
|
context.Command($"{DockerPath} {arg}");
|
||||||
@@ -470,7 +477,7 @@ namespace GitHub.Runner.Worker.Container
|
|||||||
workingDirectory: context.GetGitHubContext("workspace"),
|
workingDirectory: context.GetGitHubContext("workspace"),
|
||||||
fileName: DockerPath,
|
fileName: DockerPath,
|
||||||
arguments: arg,
|
arguments: arg,
|
||||||
environment: null,
|
environment: environment,
|
||||||
requireExitCodeZero: true,
|
requireExitCodeZero: true,
|
||||||
outputEncoding: null,
|
outputEncoding: null,
|
||||||
cancellationToken: CancellationToken.None);
|
cancellationToken: CancellationToken.None);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace GitHub.Runner.Worker.Container
|
|||||||
string pattern = $"^(?<{targetPort}>\\d+)/(?<{proto}>\\w+) -> (?<{host}>.+):(?<{hostPort}>\\d+)$";
|
string pattern = $"^(?<{targetPort}>\\d+)/(?<{proto}>\\w+) -> (?<{host}>.+):(?<{hostPort}>\\d+)$";
|
||||||
|
|
||||||
List<PortMapping> portMappings = new List<PortMapping>();
|
List<PortMapping> portMappings = new List<PortMapping>();
|
||||||
foreach(var line in portMappingLines)
|
foreach (var line in portMappingLines)
|
||||||
{
|
{
|
||||||
Match m = Regex.Match(line, pattern, RegexOptions.None, TimeSpan.FromSeconds(1));
|
Match m = Regex.Match(line, pattern, RegexOptions.None, TimeSpan.FromSeconds(1));
|
||||||
if (m.Success)
|
if (m.Success)
|
||||||
@@ -61,5 +61,19 @@ namespace GitHub.Runner.Worker.Container
|
|||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string CreateEscapedOption(string flag, string key)
|
||||||
|
{
|
||||||
|
if (String.IsNullOrEmpty(key))
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return $"{flag} \"{EscapeString(key)}\"";
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string EscapeString(string value)
|
||||||
|
{
|
||||||
|
return value.Replace("\\", "\\\\").Replace("\"", "\\\"");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,7 +134,6 @@ namespace GitHub.Runner.Worker
|
|||||||
ArgUtil.NotNull(executionContext, nameof(executionContext));
|
ArgUtil.NotNull(executionContext, nameof(executionContext));
|
||||||
ArgUtil.NotNull(container, nameof(container));
|
ArgUtil.NotNull(container, nameof(container));
|
||||||
ArgUtil.NotNullOrEmpty(container.ContainerImage, nameof(container.ContainerImage));
|
ArgUtil.NotNullOrEmpty(container.ContainerImage, nameof(container.ContainerImage));
|
||||||
|
|
||||||
Trace.Info($"Container name: {container.ContainerName}");
|
Trace.Info($"Container name: {container.ContainerName}");
|
||||||
Trace.Info($"Container image: {container.ContainerImage}");
|
Trace.Info($"Container image: {container.ContainerImage}");
|
||||||
Trace.Info($"Container options: {container.ContainerCreateOptions}");
|
Trace.Info($"Container options: {container.ContainerCreateOptions}");
|
||||||
@@ -197,6 +196,8 @@ namespace GitHub.Runner.Worker
|
|||||||
|
|
||||||
container.ContainerId = await _dockerManager.DockerCreate(executionContext, container);
|
container.ContainerId = await _dockerManager.DockerCreate(executionContext, container);
|
||||||
ArgUtil.NotNullOrEmpty(container.ContainerId, nameof(container.ContainerId));
|
ArgUtil.NotNullOrEmpty(container.ContainerId, nameof(container.ContainerId));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Start container
|
// Start container
|
||||||
int startExitCode = await _dockerManager.DockerStart(executionContext, container.ContainerId);
|
int startExitCode = await _dockerManager.DockerStart(executionContext, container.ContainerId);
|
||||||
@@ -207,20 +208,37 @@ namespace GitHub.Runner.Worker
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
// Make sure container is up and running
|
// Make sure container is up and running
|
||||||
var psOutputs = await _dockerManager.DockerPS(executionContext, $"--all --filter id={container.ContainerId} --filter status=running --no-trunc --format \"{{{{.ID}}}} {{{{.Status}}}}\"");
|
var psOutputs = await _dockerManager.DockerPS(executionContext, $"--all --filter id={container.ContainerId} --filter status=running --no-trunc --format \"{{{{.ID}}}} {{{{.Status}}}}\"");
|
||||||
|
|
||||||
if (psOutputs.FirstOrDefault(x => !string.IsNullOrEmpty(x))?.StartsWith(container.ContainerId) != true)
|
if (psOutputs.FirstOrDefault(x => !string.IsNullOrEmpty(x))?.StartsWith(container.ContainerId) != true)
|
||||||
{
|
{
|
||||||
// container is not up and running, pull docker log for this container.
|
// container is not up and running, pull docker log for this container.
|
||||||
await _dockerManager.DockerPS(executionContext, $"--all --filter id={container.ContainerId} --no-trunc --format \"{{{{.ID}}}} {{{{.Status}}}}\"");
|
await _dockerManager.DockerPS(executionContext, $"--all --filter id={container.ContainerId} --no-trunc --format \"{{{{.ID}}}} {{{{.Status}}}}\"");
|
||||||
|
|
||||||
|
|
||||||
|
//executionContext.Output("##[group]Getting docker logs..");
|
||||||
|
|
||||||
int logsExitCode = await _dockerManager.DockerLogs(executionContext, container.ContainerId);
|
int logsExitCode = await _dockerManager.DockerLogs(executionContext, container.ContainerId);
|
||||||
|
|
||||||
if (logsExitCode != 0)
|
if (logsExitCode != 0)
|
||||||
{
|
{
|
||||||
executionContext.Warning($"Docker logs fail with exit code {logsExitCode}");
|
executionContext.Warning($"Docker logs fail with exit code {logsExitCode}");
|
||||||
}
|
}
|
||||||
|
//executionContext.Output("##[endgroup]");
|
||||||
executionContext.Warning($"Docker container {container.ContainerId} is not in running state.");
|
executionContext.Warning($"Docker container {container.ContainerId} is not in running state.");
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
executionContext.Output($"##[group]Container {container.ContainerId} is not running!");
|
||||||
|
string opt = "--format=\'{{.State.ExitCode}}\'";
|
||||||
|
await _dockerManager.DockerInspect(executionContext, container.ContainerId, opt);
|
||||||
|
await _dockerManager.DockerLogs(executionContext, container.ContainerId);
|
||||||
|
//if exit code is not 0 we can maybe print a message?
|
||||||
|
//executionContext.Output("Container exit code: ");
|
||||||
|
|
||||||
|
executionContext.Output("##[endgroup]");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -369,6 +369,7 @@ namespace GitHub.Runner.Worker
|
|||||||
child.StepTelemetry.StepId = recordId;
|
child.StepTelemetry.StepId = recordId;
|
||||||
child.StepTelemetry.Stage = stage.ToString();
|
child.StepTelemetry.Stage = stage.ToString();
|
||||||
child.StepTelemetry.IsEmbedded = isEmbedded;
|
child.StepTelemetry.IsEmbedded = isEmbedded;
|
||||||
|
child.StepTelemetry.StepContextName = child.GetFullyQualifiedContextName(); ;
|
||||||
|
|
||||||
return child;
|
return child;
|
||||||
}
|
}
|
||||||
@@ -959,6 +960,8 @@ namespace GitHub.Runner.Worker
|
|||||||
_record.StartTime != null)
|
_record.StartTime != null)
|
||||||
{
|
{
|
||||||
StepTelemetry.ExecutionTimeInSeconds = (int)Math.Ceiling((_record.FinishTime - _record.StartTime)?.TotalSeconds ?? 0);
|
StepTelemetry.ExecutionTimeInSeconds = (int)Math.Ceiling((_record.FinishTime - _record.StartTime)?.TotalSeconds ?? 0);
|
||||||
|
StepTelemetry.StartTime = _record.StartTime;
|
||||||
|
StepTelemetry.FinishTime = _record.FinishTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsEmbedded &&
|
if (!IsEmbedded &&
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ namespace GitHub.Runner.Worker.Handlers
|
|||||||
TranslateToContainerPath(environment);
|
TranslateToContainerPath(environment);
|
||||||
await containerHookManager.RunScriptStepAsync(context,
|
await containerHookManager.RunScriptStepAsync(context,
|
||||||
Container,
|
Container,
|
||||||
workingDirectory,
|
workingDirectory,
|
||||||
fileName,
|
fileName,
|
||||||
arguments,
|
arguments,
|
||||||
environment,
|
environment,
|
||||||
@@ -216,7 +216,7 @@ namespace GitHub.Runner.Worker.Handlers
|
|||||||
{
|
{
|
||||||
// e.g. -e MY_SECRET maps the value into the exec'ed process without exposing
|
// e.g. -e MY_SECRET maps the value into the exec'ed process without exposing
|
||||||
// the value directly in the command
|
// the value directly in the command
|
||||||
dockerCommandArgs.Add($"-e {env.Key}");
|
dockerCommandArgs.Add(DockerUtil.CreateEscapedOption("-e", env.Key));
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(PrependPath))
|
if (!string.IsNullOrEmpty(PrependPath))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ namespace GitHub.Runner.Worker
|
|||||||
|
|
||||||
preJobSteps.Add(new JobExtensionRunner(runAsync: containerProvider.StartContainersAsync,
|
preJobSteps.Add(new JobExtensionRunner(runAsync: containerProvider.StartContainersAsync,
|
||||||
condition: $"{PipelineTemplateConstants.Success}()",
|
condition: $"{PipelineTemplateConstants.Success}()",
|
||||||
displayName: "Initialize containers",
|
displayName: "**Initialize containers**",
|
||||||
data: (object)containers));
|
data: (object)containers));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -316,6 +316,29 @@ namespace GitHub.Runner.Worker
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (message.Variables.TryGetValue("system.workflowFileFullPath", out VariableValue workflowFileFullPath))
|
||||||
|
{
|
||||||
|
context.Output($"Uses: {workflowFileFullPath.Value}");
|
||||||
|
if (message.ContextData.TryGetValue("inputs", out var pipelineContextData))
|
||||||
|
{
|
||||||
|
var inputs = pipelineContextData.AssertDictionary("inputs");
|
||||||
|
if (inputs.Any())
|
||||||
|
{
|
||||||
|
context.Output($"##[group] Inputs");
|
||||||
|
foreach (var input in inputs)
|
||||||
|
{
|
||||||
|
context.Output($" {input.Key}: {input.Value}");
|
||||||
|
}
|
||||||
|
context.Output("##[endgroup]");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(message.JobDisplayName))
|
||||||
|
{
|
||||||
|
context.Output($"Complete job name: {message.JobDisplayName}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var intraActionStates = new Dictionary<Guid, Dictionary<string, string>>();
|
var intraActionStates = new Dictionary<Guid, Dictionary<string, string>>();
|
||||||
foreach (var preStep in prepareResult.PreStepTracker)
|
foreach (var preStep in prepareResult.PreStepTracker)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ namespace GitHub.DistributedTask.WebApi
|
|||||||
[DataMember(EmitDefaultValue = false)]
|
[DataMember(EmitDefaultValue = false)]
|
||||||
public Guid StepId { get; set; }
|
public Guid StepId { get; set; }
|
||||||
|
|
||||||
|
[DataMember(EmitDefaultValue = false)]
|
||||||
|
public string StepContextName { get; set; }
|
||||||
|
|
||||||
[DataMember(EmitDefaultValue = false)]
|
[DataMember(EmitDefaultValue = false)]
|
||||||
public bool? HasRunsStep { get; set; }
|
public bool? HasRunsStep { get; set; }
|
||||||
|
|
||||||
@@ -57,6 +60,12 @@ namespace GitHub.DistributedTask.WebApi
|
|||||||
[DataMember(EmitDefaultValue = false)]
|
[DataMember(EmitDefaultValue = false)]
|
||||||
public int? ExecutionTimeInSeconds { get; set; }
|
public int? ExecutionTimeInSeconds { get; set; }
|
||||||
|
|
||||||
|
[DataMember(EmitDefaultValue = false)]
|
||||||
|
public DateTime? StartTime { get; set; }
|
||||||
|
|
||||||
|
[DataMember(EmitDefaultValue = false)]
|
||||||
|
public DateTime? FinishTime { get; set; }
|
||||||
|
|
||||||
[DataMember(EmitDefaultValue = false)]
|
[DataMember(EmitDefaultValue = false)]
|
||||||
public string ContainerHookData { get; set; }
|
public string ContainerHookData { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -144,5 +144,32 @@ namespace GitHub.Runner.Common.Tests.Worker.Container
|
|||||||
var actual = DockerUtil.ParseRegistryHostnameFromImageName(input);
|
var actual = DockerUtil.ParseRegistryHostnameFromImageName(input);
|
||||||
Assert.Equal(expected, actual);
|
Assert.Equal(expected, actual);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Theory]
|
||||||
|
[Trait("Level", "L0")]
|
||||||
|
[Trait("Category", "Worker")]
|
||||||
|
[InlineData("", "")]
|
||||||
|
[InlineData("HOME alpine:3.8 sh -c id #", "HOME alpine:3.8 sh -c id #")]
|
||||||
|
[InlineData("HOME \"alpine:3.8 sh -c id #", "HOME \\\"alpine:3.8 sh -c id #")]
|
||||||
|
[InlineData("HOME \\\"alpine:3.8 sh -c id #", "HOME \\\\\\\"alpine:3.8 sh -c id #")]
|
||||||
|
[InlineData("HOME \\\\\"alpine:3.8 sh -c id #", "HOME \\\\\\\\\\\"alpine:3.8 sh -c id #")]
|
||||||
|
[InlineData("HOME \"\"alpine:3.8 sh -c id #", "HOME \\\"\\\"alpine:3.8 sh -c id #")]
|
||||||
|
[InlineData("HOME \\\"\"alpine:3.8 sh -c id #", "HOME \\\\\\\"\\\"alpine:3.8 sh -c id #")]
|
||||||
|
[InlineData("HOME \"\\\"alpine:3.8 sh -c id #", "HOME \\\"\\\\\\\"alpine:3.8 sh -c id #")]
|
||||||
|
public void CreateEscapedOption_keyOnly(string input, string escaped)
|
||||||
|
{
|
||||||
|
var flag = "--example";
|
||||||
|
var actual = DockerUtil.CreateEscapedOption(flag, input);
|
||||||
|
string expected;
|
||||||
|
if (String.IsNullOrEmpty(input))
|
||||||
|
{
|
||||||
|
expected = "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
expected = $"{flag} \"{escaped}\"";
|
||||||
|
}
|
||||||
|
Assert.Equal(expected, actual);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -698,6 +698,31 @@ namespace GitHub.Runner.Common.Tests.Worker
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
[Trait("Level", "L0")]
|
||||||
|
[Trait("Category", "Worker")]
|
||||||
|
public void Load_CompositeActionNoUsing()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//Arrange
|
||||||
|
Setup();
|
||||||
|
|
||||||
|
var actionManifest = new ActionManifestManager();
|
||||||
|
actionManifest.Initialize(_hc);
|
||||||
|
var action_path = Path.Combine(TestUtil.GetTestDataPath(), "composite_action_without_using_token.yml");
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
var err = Assert.Throws<ArgumentException>(() => actionManifest.Load(_ec.Object, action_path));
|
||||||
|
Assert.Contains($"Fail to load {action_path}", err.Message);
|
||||||
|
_ec.Verify(x => x.AddIssue(It.Is<Issue>(s => s.Message.Contains("Missing 'using' value. 'using' requires 'composite', 'docker', 'node12' or 'node16'.")), It.IsAny<string>()), Times.Once);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Teardown();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
[Trait("Level", "L0")]
|
[Trait("Level", "L0")]
|
||||||
[Trait("Category", "Worker")]
|
[Trait("Category", "Worker")]
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
name: "composite action"
|
||||||
|
description: "test composite action without value for the 'using' token in 'runs'"
|
||||||
|
|
||||||
|
runs:
|
||||||
|
steps:
|
||||||
|
- id: mystep
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "hello world"
|
||||||
@@ -1 +1 @@
|
|||||||
2.295.0
|
2.296.1
|
||||||
Reference in New Issue
Block a user