removed throw and else on container action handler (#1873)

* removed throw and else on container action handler

* repaired merge resolution error
This commit is contained in:
Nikola Jokic
2023-06-17 03:53:52 +02:00
committed by GitHub
parent 471e3ae2d9
commit 8415f13bab
4 changed files with 59 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
namespace GitHub.Runner.Worker.Container
@@ -65,6 +66,16 @@ namespace GitHub.Runner.Worker.Container
return "";
}
public static bool IsDockerfile(string image)
{
if (image.StartsWith("docker://", StringComparison.OrdinalIgnoreCase))
{
return false;
}
var imageWithoutPath = image.Split('/').Last();
return imageWithoutPath.StartsWith("Dockerfile.", StringComparison.OrdinalIgnoreCase) || imageWithoutPath.EndsWith("Dockerfile", StringComparison.OrdinalIgnoreCase);
}
public static string CreateEscapedOption(string flag, string key)
{
if (String.IsNullOrEmpty(key))