mirror of
https://github.com/actions/runner.git
synced 2025-12-12 15:13:30 +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:
@@ -317,15 +317,28 @@ namespace GitHub.Runner.Worker
|
|||||||
|
|
||||||
if (action.Reference.Type == Pipelines.ActionSourceType.ContainerRegistry)
|
if (action.Reference.Type == Pipelines.ActionSourceType.ContainerRegistry)
|
||||||
{
|
{
|
||||||
Trace.Info("Load action that reference container from registry.");
|
if (FeatureManager.IsContainerHooksEnabled(executionContext.Global.Variables))
|
||||||
CachedActionContainers.TryGetValue(action.Id, out var container);
|
|
||||||
ArgUtil.NotNull(container, nameof(container));
|
|
||||||
definition.Data.Execution = new ContainerActionExecutionData()
|
|
||||||
{
|
{
|
||||||
Image = container.ContainerImage
|
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.");
|
||||||
|
CachedActionContainers.TryGetValue(action.Id, out var container);
|
||||||
|
ArgUtil.NotNull(container, nameof(container));
|
||||||
|
definition.Data.Execution = new ContainerActionExecutionData()
|
||||||
|
{
|
||||||
|
Image = container.ContainerImage
|
||||||
|
};
|
||||||
|
|
||||||
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)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user