From f91b2aa5dbcb16075f49c96a6108d0d418382f4d Mon Sep 17 00:00:00 2001 From: ChristopherHX Date: Thu, 2 Feb 2023 18:24:35 +0100 Subject: [PATCH] fix: Apply forcePull only for prebuild docker actions (#1599) --- pkg/runner/action.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/runner/action.go b/pkg/runner/action.go index 5614414..347544e 100644 --- a/pkg/runner/action.go +++ b/pkg/runner/action.go @@ -221,8 +221,11 @@ func execAsDocker(ctx context.Context, step actionStep, actionName string, based var prepImage common.Executor var image string + forcePull := false if strings.HasPrefix(action.Runs.Image, "docker://") { image = strings.TrimPrefix(action.Runs.Image, "docker://") + // Apply forcePull only for prebuild docker images + forcePull = rc.Config.ForcePull } else { // "-dockeraction" enshures that "./", "./test " won't get converted to "act-:latest", "act-test-:latest" which are invalid docker image names image = fmt.Sprintf("%s-dockeraction:%s", regexp.MustCompile("[^a-zA-Z0-9]").ReplaceAllString(actionName, "-"), "latest") @@ -289,7 +292,7 @@ func execAsDocker(ctx context.Context, step actionStep, actionName string, based stepContainer := newStepContainer(ctx, step, image, cmd, entrypoint) return common.NewPipelineExecutor( prepImage, - stepContainer.Pull(rc.Config.ForcePull), + stepContainer.Pull(forcePull), stepContainer.Remove().IfBool(!rc.Config.ReuseContainers), stepContainer.Create(rc.Config.ContainerCapAdd, rc.Config.ContainerCapDrop), stepContainer.Start(true),