Repository: nektos/act (language: go)

Issue:
Local workflow broken after ACT upgrade
### Bug report info

```plain text
This just happened after upgrading act to its latest version.




act version:            0.2.41
GOOS:                   darwin
GOARCH:                 amd64
NumCPU:                 12
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
        /var/run/docker.sock
        /Users/andy/.docker/run/docker.sock
Config files:
        /Users/andy/.actrc:
                -P ubuntu-latest=catthehacker/ubuntu:act-latest
                -P ubuntu-22.04=catthehacker/ubuntu:act-22.04
                -P ubuntu-20.04=catthehacker/ubuntu:act-20.04
                -P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
        Go version:            go1.19.5
        Module path:           command-line-arguments
        Main version:
        Main path:
        Main checksum:
        Build settings:
                -compiler:            gc
                -ldflags:             -X main.version=0.2.41
                CGO_ENABLED:          1
                CGO_CFLAGS:
                CGO_CPPFLAGS:
                CGO_CXXFLAGS:
                CGO_LDFLAGS:
                GOARCH:               amd64
                GOOS:                 darwin
                GOAMD64:              v1
Docker Engine:
        Engine version:        20.10.22
        Engine runtime:        runc
        Cgroup version:        2
        Cgroup driver:         cgroupfs
        Storage driver:        overlay2
        Registry URI:          https://index.docker.io/v1/
        OS:                    Docker Desktop
        OS type:               linux
        OS version:
        OS arch:               x86_64
        OS kernel:             5.15.49-linuxkit
        OS CPU:                8
        OS memory:             11978 MB
        Security options:
                name=seccomp,profile=default
                name=cgroupns
```
```


### Command used with act

```sh
act -W .github/workflows/handle_pr_insecure.yaml
```


### Describe issue

Error response from daemon: pull access denied for act-aquasecurity-trivy-action-master-dockeraction, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

### Link to GitHub repository

_No response_

### Workflow content

```yml
n/a
```


### Relevant log output

```sh
n/a
```


### Additional information

_No response_


Discussion / hints:
I'm seeing a similar message after the latest release. I'm building a local image and trying to run that, instead of pull a remote image. It might be related to https://github.com/nektos/act/pull/1569 . Is there a way to specify ``--no-pull`` in the `act` CLI or a preference file?
@lilyminium, yes, just ran into the same issue and had to use `-p=false` or `--pull=false` in the `act` CLI to get my local pre-built image to run.

Fix patch:
diff --git a/pkg/runner/action.go b/pkg/runner/action.go
index 5614414ef42..347544ed23a 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),


Test patch: