Repository: nektos/act (language: go)

Issue:
Fail to run action xu-cheng/texlive-action/full
### Bug report info

```plain text
act --bug-report
act version:            0.2.32
GOOS:                   windows
GOARCH:                 amd64
NumCPU:                 8
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
        \\.\pipe\docker_engine
Config files:
        C:\Users\alan\.actrc:
                -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest
                -P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04
                -P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:act-18.04
Build info:
        Go version:            go1.18.6
        Module path:           github.com/nektos/act
        Main version:          (devel)
        Main path:             github.com/nektos/act
        Main checksum:
        Build settings:
                -compiler:            gc
                -ldflags:             -s -w -X main.version=0.2.32 -X main.commit=21484b5c1ecbd9e1ddb6a57debd7731a3e1fc25f -X main.date=2022-10-01T03:01:40Z -X main.builtBy=goreleaser
                CGO_ENABLED:          0
                GOARCH:               amd64
                GOOS:                 windows
                GOAMD64:              v1
                vcs:                  git
                vcs.revision:         21484b5c1ecbd9e1ddb6a57debd7731a3e1fc25f
                vcs.time:             2022-09-29T05:59:52Z
                vcs.modified:         false
Docker Engine:
        Engine version:        20.10.17
        Engine runtime:        runc
        Cgroup version:        1
        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.68.1-microsoft-standard-WSL2
        OS CPU:                8
        OS memory:             3825 MB
        Security options:
                name=seccomp,profile=default
```


### Command used with act

```sh
act
```


### Describe issue

Fail to use action xu-cheng/texlive-action/full@v1 from [here](https://github.com/xu-cheng/texlive-action)

### Link to GitHub repository

_No response_

### Workflow content

```yml
jobs:
  gh-pages:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
       - uses: xu-cheng/texlive-action/full@v1
         with:
           run: 
             latexmk -shell-escape -cd -pdf file.tex
```


### Relevant log output

```sh
[gh-pages.yml/gh-pages]   ❌  Failure - Main xu-cheng/texlive-action/full@v1
[gh-pages.yml/gh-pages] exit with `FAILURE`: 127
```


### Additional information

_No response_


Discussion / hints:
> DOCKER_HOST environment variable is unset/empty.

You need to install docker on your machine

Many thanks for the response @KnisterPeter.
But the docker was installed, see my `docker info` bellow

```
$ docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.9.1)
  compose: Docker Compose (Docker Inc., v2.10.2)
  extension: Manages Docker extensions (Docker Inc., v0.2.9)
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
  scan: Docker Scan (Docker Inc., v0.19.0)

Server:
 Containers: 2
  Running: 1
  Paused: 0
  Stopped: 1
 Images: 1
 Server Version: 20.10.17
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6
 runc version: v1.1.4-0-g5fd4c4d
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 5.15.68.1-microsoft-standard-WSL2
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 3.736GiB
 Name: docker-desktop
 ID: GUIT:ASWL:7SKR:ZOET:MI2X:HYIW:BOMH:MMQX:Z6ON:4VUY:FGR4:DJOO
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5000
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support
```

Also, I am able to run the `latexmk ` command  (used in  the step) directly from "docker run"

```
$ docker run ghcr.io/xu-cheng/texlive-full latexmk
Rc files read:
  NONE
Latexmk: This is Latexmk, John Collins, 17 Mar. 2022. Version 4.77, version: 4.77.

Latexmk: No file name specified, and I couldn't find any
Use
   latexmk -help
to get usage information
```

Also, You can see in the log below that act-cli start normally and even runs the immediately previous step `uses: actions/checkout@v3`.

```
$ act
[gh-pages.yml/gh-pages] 🚀  Start image=catthehacker/ubuntu:act-latest
[gh-pages.yml/gh-pages]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false
[gh-pages.yml/gh-pages]   🐳  docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[gh-pages.yml/gh-pages]   🐳  docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[gh-pages.yml/gh-pages]   ☁  git clone 'https://github.com/xu-cheng/texlive-action' # ref=v1
[gh-pages.yml/gh-pages]   ☁  git clone 'https://github.com/actions/setup-node' # ref=v3
[gh-pages.yml/gh-pages]   ☁  git clone 'https://github.com/peaceiris/actions-gh-pages' # ref=v3
[gh-pages.yml/gh-pages] ⭐ Run Main actions/checkout@v3
[gh-pages.yml/gh-pages]   🐳  docker cp src=C:\Users\alan\src\alan.io\alanlivio.github.io\. dst=/mnt/c/Users/alan/src/alan.io/alanlivio.github.io
[gh-pages.yml/gh-pages]   ✅  Success - Main actions/checkout@v3
[gh-pages.yml/gh-pages] ⭐ Run Main xu-cheng/texlive-action/full@v1
[gh-pages.yml/gh-pages]   🐳  docker pull image=ghcr.io/xu-cheng/texlive-full:latest platform= username= forcePull=false
[gh-pages.yml/gh-pages]   🐳  docker create image=ghcr.io/xu-cheng/texlive-full:latest platform= entrypoint=["/bin/bash"] cmd=["-eo" "pipefail" "-c" "latexmk -shell-escape -cd -pdf ./latex/cv.tex"]
[gh-pages.yml/gh-pages]   🐳  docker run image=ghcr.io/xu-cheng/texlive-full:latest platform= entrypoint=["/bin/bash"] cmd=["-eo" "pipefail" "-c" "latexmk -shell-escape -cd -pdf ./latex/cv.tex"]
| /bin/bash: line 1: latexmk: command not found
[gh-pages.yml/gh-pages]   ❌  Failure - Main xu-cheng/texlive-action/full@v1
[gh-pages.yml/gh-pages] exit with `FAILURE`: 127
[gh-pages.yml/gh-pages] 🏁  Job failed
Error: Job 'gh-pages' failed
```

Do you have another suggestion?





I don't know the action. Could have plenty of reasons. Sorry.
But I'll reopen the issue, maybe someone else has a suggestion 
M assumption is, that latexmk is not in the PATH inside the docker container.
Many thanks again @KnisterPeter.

> M assumption is, that latexmk is not in the PATH inside the docker container.

I think this is not the case because the following command works.
```$ docker run ghcr.io/xu-cheng/texlive-full latexmk```

Is there a way to me better debug the error with act-cli?

This `docker run ghcr.io/xu-cheng/texlive-full latexmk` is different from what is happening in your action I think.

> [gh-pages.yml/gh-pages]   🐳  docker run image=ghcr.io/xu-cheng/texlive-full:latest platform= entrypoint=["/bin/bash"] cmd=["-eo" "pipefail" "-c" "latexmk -shell-escape -cd -pdf ./latex/cv.tex"]
> | /bin/bash: line 1: latexmk: command not found

Looks like it should be more like `docker run --entrypoint /bin/bash ghcr.io/xu-cheng/texlive-full:latest -eo pipefail -c 'latexmk -shell-escape -cd -pdf ./latex/cv.tex'`

Thanks again @KnisterPeter. 
Your suggestion run the `latexmk` indeed, but, although being in the right folder, latexmk said that the subdir does not exist. For me, It seems docker does not mount the current folder/repo as act-cli does.

```
docker run --entrypoint /bin/bash ghcr.io/xu-cheng/texlive-full:latest -eo pipefail -c 'latexmk -shell-escape -cd -pdf ./latex/cv.tex'
Rc files read:
  NONE
Latexmk: This is Latexmk, John Collins, 17 Mar. 2022. Version 4.77, version: 4.77.
Latexmk: Changing directory to './latex/'
Latexmk: Error in changing directory to './latex'.  I must stop
latexmk: Can't change directory to './latex'
   A directory of the same name does not exist.
```

I also open the bash in the container and it has the latexmk in the PATH

```
$ docker run -it ghcr.io/xu-cheng/texlive-full:latest bash
bash-5.1# latexmk
Rc files read:
  NONE
Latexmk: This is Latexmk, John Collins, 17 Mar. 2022. Version 4.77, version: 4.77.

Latexmk: No file name specified, and I couldn't find any
Use
   latexmk -help
bash-5.1# echo $PATH
/opt/texlive/texdir/bin/x86_64-linuxmusl:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
```
Issue is stale and will be closed in 14 days unless there is new activity
Hi, again @KnisterPeter. Did you say that `My assumption is, that latexmk is not in the PATH inside the docker container.`
But I checked above that the container, and it has the latexmk in the PATH.
Can I set the path during the  `docker run --entrypoint /bin/bash` call?
@alanlivio I think thats not possible. But you can for sure change the docker container and update it to your needs.

Many thanks, @KnisterPeter. 

> But you can for sure change the docker container and update it to your needs.

I think is not the case to change it. Because, as I show [up](https://github.com/nektos/act/issues/1384#issuecomment-1274802076), the docker already has the latexmk in the PATH. My may point in trying` docker run`  is to enable work in your `nektos` tool.
Do you have another suggestion on how to enable  `nektos` work with this `ghcr.io/xu-cheng/texlive-full` docker
> Do you have another suggestion on how to enable nektos work with this ghcr.io/xu-cheng/texlive-full docker

Debug act, then find and fix the bug. I believe something in act's path handling is different compared to actions/runner, act reads /etc/environment while it shouldn't do that.

**I might pick this up, once my PR queue is empty**
I think act doesn't respect this line:
`ENV PATH="/opt/texlive/texdir/bin/x86_64-linuxmusl:${PATH}"`
_I'm not shure if act once did it correctly, if so there was no test case._

Fix patch:
diff --git a/pkg/runner/action.go b/pkg/runner/action.go
index 0174dd812ed..ec7ac7cd68d 100644
--- a/pkg/runner/action.go
+++ b/pkg/runner/action.go
@@ -154,6 +154,8 @@ func runActionImpl(step actionStep, actionDir string, remoteAction *remoteAction
 			containerArgs := []string{"node", path.Join(containerActionDir, action.Runs.Main)}
 			logger.Debugf("executing remote job container: %s", containerArgs)
 
+			rc.ApplyExtraPath(step.getEnv())
+
 			return rc.execJobContainer(containerArgs, *step.getEnv(), "", "")(ctx)
 		case model.ActionRunsUsingDocker:
 			location := actionLocation
@@ -486,6 +488,8 @@ func runPreStep(step actionStep) common.Executor {
 			containerArgs := []string{"node", path.Join(containerActionDir, action.Runs.Pre)}
 			logger.Debugf("executing remote job container: %s", containerArgs)
 
+			rc.ApplyExtraPath(step.getEnv())
+
 			return rc.execJobContainer(containerArgs, *step.getEnv(), "", "")(ctx)
 
 		case model.ActionRunsUsingComposite:
@@ -573,6 +577,8 @@ func runPostStep(step actionStep) common.Executor {
 			containerArgs := []string{"node", path.Join(containerActionDir, action.Runs.Post)}
 			logger.Debugf("executing remote job container: %s", containerArgs)
 
+			rc.ApplyExtraPath(step.getEnv())
+
 			return rc.execJobContainer(containerArgs, *step.getEnv(), "", "")(ctx)
 
 		case model.ActionRunsUsingComposite:
diff --git a/pkg/runner/command.go b/pkg/runner/command.go
index a68be16d802..3fa371510ca 100755
--- a/pkg/runner/command.go
+++ b/pkg/runner/command.go
@@ -101,7 +101,13 @@ func (rc *RunContext) setOutput(ctx context.Context, kvPairs map[string]string,
 }
 func (rc *RunContext) addPath(ctx context.Context, arg string) {
 	common.Logger(ctx).Infof("  \U00002699  ::add-path:: %s", arg)
-	rc.ExtraPath = append(rc.ExtraPath, arg)
+	extraPath := []string{arg}
+	for _, v := range rc.ExtraPath {
+		if v != arg {
+			extraPath = append(extraPath, v)
+		}
+	}
+	rc.ExtraPath = extraPath
 }
 
 func parseKeyValuePairs(kvPairs string, separator string) map[string]string {
diff --git a/pkg/runner/run_context.go b/pkg/runner/run_context.go
index 30548f55420..c653cc7e89a 100644
--- a/pkg/runner/run_context.go
+++ b/pkg/runner/run_context.go
@@ -1,12 +1,15 @@
 package runner
 
 import (
+	"archive/tar"
+	"bufio"
 	"context"
 	"crypto/rand"
 	"encoding/hex"
 	"encoding/json"
 	"errors"
 	"fmt"
+	"io"
 	"os"
 	"path/filepath"
 	"regexp"
@@ -188,10 +191,6 @@ func (rc *RunContext) startHostEnvironment() common.Executor {
 				Name: "workflow/envs.txt",
 				Mode: 0666,
 				Body: "",
-			}, &container.FileEntry{
-				Name: "workflow/paths.txt",
-				Mode: 0666,
-				Body: "",
 			}),
 		)(ctx)
 	}
@@ -277,10 +276,6 @@ func (rc *RunContext) startJobContainer() common.Executor {
 				Name: "workflow/envs.txt",
 				Mode: 0666,
 				Body: "",
-			}, &container.FileEntry{
-				Name: "workflow/paths.txt",
-				Mode: 0666,
-				Body: "",
 			}),
 		)(ctx)
 	}
@@ -292,6 +287,41 @@ func (rc *RunContext) execJobContainer(cmd []string, env map[string]string, user
 	}
 }
 
+func (rc *RunContext) ApplyExtraPath(env *map[string]string) {
+	if rc.ExtraPath != nil && len(rc.ExtraPath) > 0 {
+		path := rc.JobContainer.GetPathVariableName()
+		if (*env)[path] == "" {
+			(*env)[path] = rc.JobContainer.DefaultPathVariable()
+		}
+		(*env)[path] = rc.JobContainer.JoinPathVariable(append(rc.ExtraPath, (*env)[path])...)
+	}
+}
+
+func (rc *RunContext) UpdateExtraPath(ctx context.Context, githubEnvPath string) error {
+	if common.Dryrun(ctx) {
+		return nil
+	}
+	pathTar, err := rc.JobContainer.GetContainerArchive(ctx, githubEnvPath)
+	if err != nil {
+		return err
+	}
+	defer pathTar.Close()
+
+	reader := tar.NewReader(pathTar)
+	_, err = reader.Next()
+	if err != nil && err != io.EOF {
+		return err
+	}
+	s := bufio.NewScanner(reader)
+	for s.Scan() {
+		line := s.Text()
+		if len(line) > 0 {
+			rc.addPath(ctx, line)
+		}
+	}
+	return nil
+}
+
 // stopJobContainer removes the job container (if it exists) and its volume (if it exists) if !rc.Config.ReuseContainers
 func (rc *RunContext) stopJobContainer() common.Executor {
 	return func(ctx context.Context) error {
@@ -639,7 +669,6 @@ func nestedMapLookup(m map[string]interface{}, ks ...string) (rval interface{})
 func (rc *RunContext) withGithubEnv(ctx context.Context, github *model.GithubContext, env map[string]string) map[string]string {
 	env["CI"] = "true"
 	env["GITHUB_ENV"] = rc.JobContainer.GetActPath() + "/workflow/envs.txt"
-	env["GITHUB_PATH"] = rc.JobContainer.GetActPath() + "/workflow/paths.txt"
 	env["GITHUB_WORKFLOW"] = github.Workflow
 	env["GITHUB_RUN_ID"] = github.RunID
 	env["GITHUB_RUN_NUMBER"] = github.RunNumber
diff --git a/pkg/runner/step.go b/pkg/runner/step.go
index a3829fb9bbe..f8a192fdc30 100644
--- a/pkg/runner/step.go
+++ b/pkg/runner/step.go
@@ -100,14 +100,19 @@ func runStepExecutor(step step, stage stepStage, executor common.Executor) commo
 		actPath := rc.JobContainer.GetActPath()
 		outputFileCommand := path.Join("workflow", "outputcmd.txt")
 		stateFileCommand := path.Join("workflow", "statecmd.txt")
+		pathFileCommand := path.Join("workflow", "pathcmd.txt")
 		(*step.getEnv())["GITHUB_OUTPUT"] = path.Join(actPath, outputFileCommand)
 		(*step.getEnv())["GITHUB_STATE"] = path.Join(actPath, stateFileCommand)
+		(*step.getEnv())["GITHUB_PATH"] = path.Join(actPath, pathFileCommand)
 		_ = rc.JobContainer.Copy(actPath, &container.FileEntry{
 			Name: outputFileCommand,
 			Mode: 0666,
 		}, &container.FileEntry{
 			Name: stateFileCommand,
 			Mode: 0666,
+		}, &container.FileEntry{
+			Name: pathFileCommand,
+			Mode: 0666,
 		})(ctx)
 
 		err = executor(ctx)
@@ -151,6 +156,10 @@ func runStepExecutor(step step, stage stepStage, executor common.Executor) commo
 		for k, v := range output {
 			rc.setOutput(ctx, map[string]string{"name": k}, v)
 		}
+		err = rc.UpdateExtraPath(ctx, path.Join(actPath, pathFileCommand))
+		if err != nil {
+			return err
+		}
 		if orgerr != nil {
 			return orgerr
 		}
@@ -170,10 +179,6 @@ func setupEnv(ctx context.Context, step step) error {
 	if err != nil {
 		return err
 	}
-	err = rc.JobContainer.UpdateFromPath(step.getEnv())(ctx)
-	if err != nil {
-		return err
-	}
 	// merge step env last, since it should not be overwritten
 	mergeIntoMap(step.getEnv(), step.getStepModel().GetEnv())
 
@@ -209,14 +214,6 @@ func mergeEnv(ctx context.Context, step step) {
 		mergeIntoMap(env, rc.GetEnv())
 	}
 
-	path := rc.JobContainer.GetPathVariableName()
-	if (*env)[path] == "" {
-		(*env)[path] = rc.JobContainer.DefaultPathVariable()
-	}
-	if rc.ExtraPath != nil && len(rc.ExtraPath) > 0 {
-		(*env)[path] = rc.JobContainer.JoinPathVariable(append(rc.ExtraPath, (*env)[path])...)
-	}
-
 	rc.withGithubEnv(ctx, step.getGithubContext(ctx), *env)
 }
 
diff --git a/pkg/runner/step_run.go b/pkg/runner/step_run.go
index a74f781b234..17db77af6ec 100644
--- a/pkg/runner/step_run.go
+++ b/pkg/runner/step_run.go
@@ -30,6 +30,7 @@ func (sr *stepRun) main() common.Executor {
 	return runStepExecutor(sr, stepStageMain, common.NewPipelineExecutor(
 		sr.setupShellCommandExecutor(),
 		func(ctx context.Context) error {
+			sr.getRunContext().ApplyExtraPath(&sr.env)
 			return sr.getRunContext().JobContainer.Exec(sr.cmd, sr.env, "", sr.Step.WorkingDirectory)(ctx)
 		},
 	))


Test patch:
diff --git a/pkg/runner/command_test.go b/pkg/runner/command_test.go
index 0b6ec8cbc5b..8f71af67010 100644
--- a/pkg/runner/command_test.go
+++ b/pkg/runner/command_test.go
@@ -64,7 +64,7 @@ func TestAddpath(t *testing.T) {
 	a.Equal("/zoo", rc.ExtraPath[0])
 
 	handler("::add-path::/boo\n")
-	a.Equal("/boo", rc.ExtraPath[1])
+	a.Equal("/boo", rc.ExtraPath[0])
 }
 
 func TestStopCommands(t *testing.T) {
@@ -102,7 +102,7 @@ func TestAddpathADO(t *testing.T) {
 	a.Equal("/zoo", rc.ExtraPath[0])
 
 	handler("##[add-path]/boo\n")
-	a.Equal("/boo", rc.ExtraPath[1])
+	a.Equal("/boo", rc.ExtraPath[0])
 }
 
 func TestAddmask(t *testing.T) {
diff --git a/pkg/runner/container_mock_test.go b/pkg/runner/container_mock_test.go
index 0de0781586f..19f890396c4 100644
--- a/pkg/runner/container_mock_test.go
+++ b/pkg/runner/container_mock_test.go
@@ -2,6 +2,7 @@ package runner
 
 import (
 	"context"
+	"io"
 
 	"github.com/nektos/act/pkg/common"
 	"github.com/nektos/act/pkg/container"
@@ -63,7 +64,17 @@ func (cm *containerMock) CopyDir(destPath string, srcPath string, useGitIgnore b
 	args := cm.Called(destPath, srcPath, useGitIgnore)
 	return args.Get(0).(func(context.Context) error)
 }
+
 func (cm *containerMock) Exec(command []string, env map[string]string, user, workdir string) common.Executor {
 	args := cm.Called(command, env, user, workdir)
 	return args.Get(0).(func(context.Context) error)
 }
+
+func (cm *containerMock) GetContainerArchive(ctx context.Context, srcPath string) (io.ReadCloser, error) {
+	args := cm.Called(ctx, srcPath)
+	err, hasErr := args.Get(1).(error)
+	if !hasErr {
+		err = nil
+	}
+	return args.Get(0).(io.ReadCloser), err
+}
diff --git a/pkg/runner/step_action_local_test.go b/pkg/runner/step_action_local_test.go
index 639028989a2..9ece06a4172 100644
--- a/pkg/runner/step_action_local_test.go
+++ b/pkg/runner/step_action_local_test.go
@@ -1,7 +1,9 @@
 package runner
 
 import (
+	"bytes"
 	"context"
+	"io"
 	"path/filepath"
 	"strings"
 	"testing"
@@ -75,10 +77,6 @@ func TestStepActionLocalTest(t *testing.T) {
 		return nil
 	})
 
-	cm.On("UpdateFromPath", mock.AnythingOfType("*map[string]string")).Return(func(ctx context.Context) error {
-		return nil
-	})
-
 	cm.On("Copy", "/var/run/act", mock.AnythingOfType("[]*container.FileEntry")).Return(func(ctx context.Context) error {
 		return nil
 	})
@@ -91,6 +89,8 @@ func TestStepActionLocalTest(t *testing.T) {
 		return nil
 	})
 
+	cm.On("GetContainerArchive", ctx, "/var/run/act/workflow/pathcmd.txt").Return(io.NopCloser(&bytes.Buffer{}), nil)
+
 	salm.On("runAction", sal, filepath.Clean("/tmp/path/to/action"), (*remoteAction)(nil)).Return(func(ctx context.Context) error {
 		return nil
 	})
@@ -280,7 +280,6 @@ func TestStepActionLocalPost(t *testing.T) {
 			if tt.mocks.env {
 				cm.On("UpdateFromImageEnv", &sal.env).Return(func(ctx context.Context) error { return nil })
 				cm.On("UpdateFromEnv", "/var/run/act/workflow/envs.txt", &sal.env).Return(func(ctx context.Context) error { return nil })
-				cm.On("UpdateFromPath", &sal.env).Return(func(ctx context.Context) error { return nil })
 			}
 			if tt.mocks.exec {
 				suffixMatcher := func(suffix string) interface{} {
@@ -301,6 +300,8 @@ func TestStepActionLocalPost(t *testing.T) {
 				cm.On("UpdateFromEnv", "/var/run/act/workflow/outputcmd.txt", mock.AnythingOfType("*map[string]string")).Return(func(ctx context.Context) error {
 					return nil
 				})
+
+				cm.On("GetContainerArchive", ctx, "/var/run/act/workflow/pathcmd.txt").Return(io.NopCloser(&bytes.Buffer{}), nil)
 			}
 
 			err := sal.post()(ctx)
diff --git a/pkg/runner/step_action_remote_test.go b/pkg/runner/step_action_remote_test.go
index 72b0eeeb3a4..829e3864485 100644
--- a/pkg/runner/step_action_remote_test.go
+++ b/pkg/runner/step_action_remote_test.go
@@ -1,8 +1,10 @@
 package runner
 
 import (
+	"bytes"
 	"context"
 	"errors"
+	"io"
 	"strings"
 	"testing"
 
@@ -166,7 +168,6 @@ func TestStepActionRemote(t *testing.T) {
 			if tt.mocks.env {
 				cm.On("UpdateFromImageEnv", &sar.env).Return(func(ctx context.Context) error { return nil })
 				cm.On("UpdateFromEnv", "/var/run/act/workflow/envs.txt", &sar.env).Return(func(ctx context.Context) error { return nil })
-				cm.On("UpdateFromPath", &sar.env).Return(func(ctx context.Context) error { return nil })
 			}
 			if tt.mocks.read {
 				sarm.On("readAction", sar.Step, suffixMatcher("act/remote-action@v1"), "", mock.Anything, mock.Anything).Return(&model.Action{}, nil)
@@ -185,6 +186,8 @@ func TestStepActionRemote(t *testing.T) {
 				cm.On("UpdateFromEnv", "/var/run/act/workflow/outputcmd.txt", mock.AnythingOfType("*map[string]string")).Return(func(ctx context.Context) error {
 					return nil
 				})
+
+				cm.On("GetContainerArchive", ctx, "/var/run/act/workflow/pathcmd.txt").Return(io.NopCloser(&bytes.Buffer{}), nil)
 			}
 
 			err := sar.pre()(ctx)
@@ -592,7 +595,6 @@ func TestStepActionRemotePost(t *testing.T) {
 			if tt.mocks.env {
 				cm.On("UpdateFromImageEnv", &sar.env).Return(func(ctx context.Context) error { return nil })
 				cm.On("UpdateFromEnv", "/var/run/act/workflow/envs.txt", &sar.env).Return(func(ctx context.Context) error { return nil })
-				cm.On("UpdateFromPath", &sar.env).Return(func(ctx context.Context) error { return nil })
 			}
 			if tt.mocks.exec {
 				cm.On("Exec", []string{"node", "/var/run/act/actions/remote-action@v1/post.js"}, sar.env, "", "").Return(func(ctx context.Context) error { return tt.err })
@@ -608,6 +610,8 @@ func TestStepActionRemotePost(t *testing.T) {
 				cm.On("UpdateFromEnv", "/var/run/act/workflow/outputcmd.txt", mock.AnythingOfType("*map[string]string")).Return(func(ctx context.Context) error {
 					return nil
 				})
+
+				cm.On("GetContainerArchive", ctx, "/var/run/act/workflow/pathcmd.txt").Return(io.NopCloser(&bytes.Buffer{}), nil)
 			}
 
 			err := sar.post()(ctx)
diff --git a/pkg/runner/step_docker_test.go b/pkg/runner/step_docker_test.go
index 2008357f5c0..c26ffd685a9 100644
--- a/pkg/runner/step_docker_test.go
+++ b/pkg/runner/step_docker_test.go
@@ -1,7 +1,9 @@
 package runner
 
 import (
+	"bytes"
 	"context"
+	"io"
 	"testing"
 
 	"github.com/nektos/act/pkg/container"
@@ -63,10 +65,6 @@ func TestStepDockerMain(t *testing.T) {
 		return nil
 	})
 
-	cm.On("UpdateFromPath", mock.AnythingOfType("*map[string]string")).Return(func(ctx context.Context) error {
-		return nil
-	})
-
 	cm.On("Pull", false).Return(func(ctx context.Context) error {
 		return nil
 	})
@@ -99,6 +97,8 @@ func TestStepDockerMain(t *testing.T) {
 		return nil
 	})
 
+	cm.On("GetContainerArchive", ctx, "/var/run/act/workflow/pathcmd.txt").Return(io.NopCloser(&bytes.Buffer{}), nil)
+
 	err := sd.main()(ctx)
 	assert.Nil(t, err)
 
diff --git a/pkg/runner/step_run_test.go b/pkg/runner/step_run_test.go
index e5cde1238e9..324ed5fcc8f 100644
--- a/pkg/runner/step_run_test.go
+++ b/pkg/runner/step_run_test.go
@@ -1,7 +1,9 @@
 package runner
 
 import (
+	"bytes"
 	"context"
+	"io"
 	"testing"
 
 	"github.com/nektos/act/pkg/container"
@@ -61,10 +63,6 @@ func TestStepRun(t *testing.T) {
 		return nil
 	})
 
-	cm.On("UpdateFromPath", mock.AnythingOfType("*map[string]string")).Return(func(ctx context.Context) error {
-		return nil
-	})
-
 	cm.On("Copy", "/var/run/act", mock.AnythingOfType("[]*container.FileEntry")).Return(func(ctx context.Context) error {
 		return nil
 	})
@@ -79,6 +77,8 @@ func TestStepRun(t *testing.T) {
 
 	ctx := context.Background()
 
+	cm.On("GetContainerArchive", ctx, "/var/run/act/workflow/pathcmd.txt").Return(io.NopCloser(&bytes.Buffer{}), nil)
+
 	err := sr.main()(ctx)
 	assert.Nil(t, err)
 
diff --git a/pkg/runner/step_test.go b/pkg/runner/step_test.go
index b72f9975fb3..8930cca3e7f 100644
--- a/pkg/runner/step_test.go
+++ b/pkg/runner/step_test.go
@@ -134,7 +134,6 @@ func TestSetupEnv(t *testing.T) {
 		Env: map[string]string{
 			"RC_KEY": "rcvalue",
 		},
-		ExtraPath:    []string{"/path/to/extra/file"},
 		JobContainer: cm,
 	}
 	step := &model.Step{
@@ -142,9 +141,7 @@ func TestSetupEnv(t *testing.T) {
 			"STEP_WITH": "with-value",
 		},
 	}
-	env := map[string]string{
-		"PATH": "",
-	}
+	env := map[string]string{}
 
 	sm.On("getRunContext").Return(rc)
 	sm.On("getGithubContext").Return(rc)
@@ -153,7 +150,6 @@ func TestSetupEnv(t *testing.T) {
 
 	cm.On("UpdateFromImageEnv", &env).Return(func(ctx context.Context) error { return nil })
 	cm.On("UpdateFromEnv", "/var/run/act/workflow/envs.txt", &env).Return(func(ctx context.Context) error { return nil })
-	cm.On("UpdateFromPath", &env).Return(func(ctx context.Context) error { return nil })
 
 	err := setupEnv(context.Background(), sm)
 	assert.Nil(t, err)
@@ -184,7 +180,6 @@ func TestSetupEnv(t *testing.T) {
 		"GITHUB_GRAPHQL_URL":       "https:///api/graphql",
 		"GITHUB_HEAD_REF":          "",
 		"GITHUB_JOB":               "",
-		"GITHUB_PATH":              "/var/run/act/workflow/paths.txt",
 		"GITHUB_RETENTION_DAYS":    "0",
 		"GITHUB_RUN_ID":            "runId",
 		"GITHUB_RUN_NUMBER":        "1",
@@ -192,7 +187,6 @@ func TestSetupEnv(t *testing.T) {
 		"GITHUB_TOKEN":             "",
 		"GITHUB_WORKFLOW":          "",
 		"INPUT_STEP_WITH":          "with-value",
-		"PATH":                     "/path/to/extra/file:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
 		"RC_KEY":                   "rcvalue",
 		"RUNNER_PERFLOG":           "/dev/null",
 		"RUNNER_TRACKING_ID":       "",