Repository: nektos/act (language: go)

Issue:
Issue: act actions/checkout fails for dangling symlinks
<!--
    - Make sure you are able to reproduce it on the [latest version](https://github.com/nektos/act/releases)
    - Search the existing issues.
    - Refer to [README](https://github.com/nektos/act/blob/master/README.md).
-->

## System information

- Operating System: macOS
- Architecture: x64 (64-bit)
- Docker version: 20.10.11
- `act` version: 0.2.25

## Expected behaviour

checkout should run and the echo step should run

## Actual behaviour

pseudo checkout failed

## Workflow and/or repository

https://github.com/jsoref/act-dangling

## Steps to reproduce

```
git clone https://github.com/jsoref/act-dangling
cd act-dangling
act
```

## `act` output

<details>
  <summary>Log</summary>

```
[Test/Test] 🚀  Start image=catthehacker/ubuntu:act-latest
[Test/Test]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false
[Test/Test]   🐳  docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Test/Test]   🐳  docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Test/Test]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir=
[Test/Test]   🐳  docker cp src=/Users/jsoref/code/act/dangling/. dst=/Users/jsoref/code/act/dangling
[Test/Test]   🐳  docker exec cmd=[mkdir -p /Users/jsoref/code/act/dangling] user= workdir=
Error: open /Users/jsoref/code/act/dangling/baz: no such file or directory
```

</details>



Discussion / hints:

Fix patch:
diff --git a/pkg/container/docker_run.go b/pkg/container/docker_run.go
index 2077a8e0cd4..9fb8123ea9a 100644
--- a/pkg/container/docker_run.go
+++ b/pkg/container/docker_run.go
@@ -627,6 +627,11 @@ func (cr *containerReference) copyDir(dstPath string, srcPath string, useGitIgno
 				return err
 			}
 
+			// symlinks don't need to be copied
+			if fi.Mode()&os.ModeSymlink == os.ModeSymlink {
+				return nil
+			}
+
 			// open files for taring
 			f, err := os.Open(file)
 			if err != nil {
@@ -635,10 +640,6 @@ func (cr *containerReference) copyDir(dstPath string, srcPath string, useGitIgno
 
 			// copy file data into tar writer
 			if _, err := io.Copy(tw, f); err != nil {
-				if fi.Mode()&os.ModeSymlink == os.ModeSymlink {
-					// symlinks don't need to be copied, ignore this error
-					err = nil
-				}
 				return err
 			}
 


Test patch: