mirror of
https://github.com/actions/runner.git
synced 2025-12-14 03:49:48 +00:00
Fix uses: docker://image:tag steps when container hook is used (#2626)
* Fix `uses: docker://image:tag` steps when container hook is used * Update src/Runner.Worker/ActionManager.cs --------- Co-authored-by: Ferenc Hammerl <31069338+fhammerl@users.noreply.github.com>
This commit is contained in:
@@ -316,6 +316,18 @@ namespace GitHub.Runner.Worker
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (action.Reference.Type == Pipelines.ActionSourceType.ContainerRegistry)
|
if (action.Reference.Type == Pipelines.ActionSourceType.ContainerRegistry)
|
||||||
|
{
|
||||||
|
if (FeatureManager.IsContainerHooksEnabled(executionContext.Global.Variables))
|
||||||
|
{
|
||||||
|
Trace.Info("Load action that will run container through container hooks.");
|
||||||
|
var containerAction = action.Reference as Pipelines.ContainerRegistryReference;
|
||||||
|
definition.Data.Execution = new ContainerActionExecutionData()
|
||||||
|
{
|
||||||
|
Image = containerAction.Image,
|
||||||
|
};
|
||||||
|
Trace.Info($"Using action container image: {containerAction.Image}.");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
Trace.Info("Load action that reference container from registry.");
|
Trace.Info("Load action that reference container from registry.");
|
||||||
CachedActionContainers.TryGetValue(action.Id, out var container);
|
CachedActionContainers.TryGetValue(action.Id, out var container);
|
||||||
@@ -327,6 +339,7 @@ namespace GitHub.Runner.Worker
|
|||||||
|
|
||||||
Trace.Info($"Using action container image: {container.ContainerImage}.");
|
Trace.Info($"Using action container image: {container.ContainerImage}.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (action.Reference.Type == Pipelines.ActionSourceType.Repository)
|
else if (action.Reference.Type == Pipelines.ActionSourceType.Repository)
|
||||||
{
|
{
|
||||||
string actionDirectory = null;
|
string actionDirectory = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user