Repository: nektos/act (language: go)

Issue:
Like Git does, act should also ignore the entries in git/info/exclude as well as the ones in ./.gitignore






<!--
    - 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: < Windows | Linux | macOS | etc... >
    - Architecture: < x64 (64-bit) | x86 (32-bit) | arm64 (64-bit) | arm (32-bit) | etc... >
    - Apple M1: < yes | no >
    - Docker version: < output of `docker system info -f "{{.ServerVersion}}"` >
    - Docker image used in `act`: < can be omitted if it's included in log >
    - `act` version: < output of `act --version`, if you've built `act` yourself, please provide commit hash >
-->

- Operating System: Arch Linux
- Architecture: x64 (64-bit)
- Apple M1: nope
- Docker version: Docker version 20.10.12, build e91ed5707e
- Docker image used in `act`: Digest: sha256:c8897bb05bc79498622123863d4459ce4a585fabc03ec35757b5e008ef6804dd; Status: Image is up to date for ghcr.io/catthehacker/ubuntu:act-latest
- `act` version: act version 0.2.25

## Expected behaviour

<!--
    - Describe how whole process should go and finish
-->

```shell
testproj % act pull_request                                                                                       
[Run tests on Pull Request or Push/Run tests] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[Run tests on Pull Request or Push/Run tests]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=false
[Run tests on Pull Request or Push/Run tests]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Run tests on Pull Request or Push/Run tests]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Run tests on Pull Request or Push/Run tests]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir=
[Run tests on Pull Request or Push/Run tests]   🐳  docker cp src=/home/matt/Projects/testproj/. dst=/home/matt/Projects/testproj
[Run tests on Pull Request or Push/Run tests]   🐳  docker exec cmd=[mkdir -p /home/matt/Projects/testproj] user= workdir=
[...]
```

This is where the process stopped. I expected it would continue until the workflow was finished.

## Actual behaviour

<!--
    - Describe the issue
-->

I received this error, and the process errored out:

```
Error: open /home/matt/Projects/testproj/.local/excluded/_tmp/.com.google.Chrome.0NN5Rf/SingletonCookie: no such file or directory
```

This file caused the process to stop because it's a broken symlink in a remapped /tmp directory that I was using for development.

I didn't expect that it would be trying to access that file, since it's in my `.git/info/exclude` file, which I expected to be included in the gitignore filters that are used by default to filter files being uploaded to the container.

## Workflow and/or repository

<!--
    - Provide workflow with which we can reproduce the issue
      OR
    - Provide link to your GitHub repository that contains the workflow

<details>
  <summary>workflow</summary>

```none
name: example workflow

on: [push]

jobs:
  [...]
```

</details>

## Steps to reproduce

<!--
    - Make sure to include full command with parameters you used to run `act`, example:
      1. Clone example repo (https://github.com/cplee/github-actions-demo)
      2. Enter cloned repo directory
      3. Run `act -s SUPER_SECRET=im-a-value`
-->

This is not applicable to this situation, since it never got to the workflow. To recreate, make a broken symlink in your project directory and ignore it with `.git/info/exclude`. Then try any workflow and I assume it will happen.

## `act` output

<!--
    - Use `act` with `-v`/`--verbose` and paste output from your terminal in code block below
-->

<details>
  <summary>Log</summary>

```none
DEBU[0000] Loading environment from /home/matt/Projects/testproj/.env 
DEBU[0000] Loading secrets from /home/matt/Projects/testproj/.secrets
DEBU[0000] Loading workflows from '/home/matt/Projects/testproj/.github/workflows'
DEBU[0000] Loading workflows recursively                
DEBU[0000] Found workflow 'tagged-release.yml' in '/home/matt/Projects/testproj/.github/workflows/tagged-release.yml'
DEBU[0000] Found workflow 'test.yml' in '/home/matt/Projects/testproj/.github/workflows/test.yml'
DEBU[0000] Reading workflow '/home/matt/Projects/testproj/.github/workflows/tagged-release.yml'
DEBU[0000] Correcting if statements '/home/matt/Projects/testproj/.github/workflows/tagged-release.yml'
DEBU[0000] Reading workflow '/home/matt/Projects/testproj/.github/workflows/test.yml'
DEBU[0000] Correcting if statements '/home/matt/Projects/testproj/.github/workflows/test.yml'
DEBU[0000] Planning event: pull_request                 
DEBU[0000] Loading slug from git directory '/home/matt/Projects/testproj/.git'
DEBU[0000] Found revision: a8d08eb3f59d240281ecc1efcb43e6365f0f5496
DEBU[0000] Loading revision from git directory '/home/matt/Projects/testproj/.git'
DEBU[0000] Found revision: a8d08eb3f59d240281ecc1efcb43e6365f0f5496
DEBU[0000] HEAD points to 'a8d08eb3f59d240281ecc1efcb43e6365f0f5496'
DEBU[0000] using github ref: refs/heads/work-karma-up   
DEBU[0000] context env => map[ACT:true]                 
DEBU[0000] context needs => map[]                       
[Run tests on Pull Request or Push/Run tests] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
DEBU[0000] Loading slug from git directory '/home/matt/Projects/testproj/.git'
DEBU[0000] Found revision: a8d08eb3f59d240281ecc1efcb43e6365f0f5496
DEBU[0000] Loading revision from git directory '/home/matt/Projects/testproj/.git'
DEBU[0000] Found revision: a8d08eb3f59d240281ecc1efcb43e6365f0f5496
DEBU[0000] HEAD points to 'a8d08eb3f59d240281ecc1efcb43e6365f0f5496'
DEBU[0000] using github ref: refs/heads/work-karma-up   
[Run tests on Pull Request or Push/Run tests]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=false
[Run tests on Pull Request or Push/Run tests]   🐳  docker pull ghcr.io/catthehacker/ubuntu:act-latest
DEBU[0000] Image exists? true                           
[Run tests on Pull Request or Push/Run tests] Removed container: b4e35aaf99491f0a5aea90601d2b1741488b0d6a89701ff4d5094005539f3ccb
[Run tests on Pull Request or Push/Run tests]   🐳  docker volume rm act-Run-tests-on-Pull-Request-or-Push-Run-tests
[Run tests on Pull Request or Push/Run tests]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Run tests on Pull Request or Push/Run tests] Created container name=act-Run-tests-on-Pull-Request-or-Push-Run-tests id=3a515cc5ac97debce07bf2c172749afc4989ddf4ba0e5c05c585c234a9e5ff62 from image ghcr.io/catthehacker/ubuntu:act-latest (platform: )
[Run tests on Pull Request or Push/Run tests] ENV ==> [RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_TEMP=/tmp]
[Run tests on Pull Request or Push/Run tests]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Run tests on Pull Request or Push/Run tests] Starting container: 3a515cc5ac97debce07bf2c172749afc4989ddf4ba0e5c05c585c234a9e5ff62
[Run tests on Pull Request or Push/Run tests] Started container: 3a515cc5ac97debce07bf2c172749afc4989ddf4ba0e5c05c585c234a9e5ff62
[Run tests on Pull Request or Push/Run tests]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir=
[Run tests on Pull Request or Push/Run tests] Exec command '[mkdir -m 0777 -p /var/run/act]'
[Run tests on Pull Request or Push/Run tests] Working directory '/home/matt/Projects/testproj'
[Run tests on Pull Request or Push/Run tests]   🐳  docker cp src=/home/matt/Projects/testproj/. dst=/home/matt/Projects/testproj
[Run tests on Pull Request or Push/Run tests]   🐳  docker exec cmd=[mkdir -p /home/matt/Projects/testproj] user= workdir=
[Run tests on Pull Request or Push/Run tests] Exec command '[mkdir -p /home/matt/Projects/testproj]'
[Run tests on Pull Request or Push/Run tests] Working directory '/home/matt/Projects/testproj'
DEBU[0000] Writing tarball /tmp/act3709751762 from /home/matt/Projects/testproj/.
DEBU[0000] Stripping prefix:/home/matt/Projects/testproj/ src:/home/matt/Projects/testproj/.
DEBU[0000] open /home/matt/Projects/testproj/.local/excluded/_tmp/.com.google.Chrome.0NN5Rf/SingletonCookie: no such file or directory
DEBU[0000] open /home/matt/Projects/testproj/.local/excluded/_tmp/.com.google.Chrome.0NN5Rf/SingletonCookie: no such file or directory
DEBU[0000] open /home/matt/Projects/testproj/.local/excluded/_tmp/.com.google.Chrome.0NN5Rf/SingletonCookie: no such file or directory
DEBU[0000] open /home/matt/Projects/testproj/.local/excluded/_tmp/.com.google.Chrome.0NN5Rf/SingletonCookie: no such file or directory
DEBU[0000] open /home/matt/Projects/testproj/.local/excluded/_tmp/.com.google.Chrome.0NN5Rf/SingletonCookie: no such file or directory
DEBU[0000] open /home/matt/Projects/testproj/.local/excluded/_tmp/.com.google.Chrome.0NN5Rf/SingletonCookie: no such file or directory
DEBU[0000] open /home/matt/Projects/testproj/.local/excluded/_tmp/.com.google.Chrome.0NN5Rf/SingletonCookie: no such file or directory
DEBU[0000] open /home/matt/Projects/testproj/.local/excluded/_tmp/.com.google.Chrome.0NN5Rf/SingletonCookie: no such file or directory
DEBU[0000] open /home/matt/Projects/testproj/.local/excluded/_tmp/.com.google.Chrome.0NN5Rf/SingletonCookie: no such file or directory
DEBU[0000] Loading slug from git directory '/home/matt/Projects/testproj/.git'
DEBU[0000] Found revision: a8d08eb3f59d240281ecc1efcb43e6365f0f5496
DEBU[0000] Loading revision from git directory '/home/matt/Projects/testproj/.git'
DEBU[0000] Found revision: a8d08eb3f59d240281ecc1efcb43e6365f0f5496
DEBU[0000] HEAD points to 'a8d08eb3f59d240281ecc1efcb43e6365f0f5496'
DEBU[0000] using github ref: refs/heads/work-karma-up   
DEBU[0000] context env => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache DEBIAN_FRONTEND:noninteractive DEPLOYMENT_BASEPATH:/opt/runner IMAGE_OS:ubuntu20 ImageOS:ubuntu20 LSB_OS_VERSION:2004 LSB_RELEASE:20.04 PATH:/opt/hostedtoolcache/node/14.19.0/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root]
DEBU[0000] context needs => map[]                       
Error: open /home/matt/Projects/testproj/.local/excluded/_tmp/.com.google.Chrome.0NN5Rf/SingletonCookie: no such file or directory
```

</details>

By the way, I just found this project and It's already saving me a bunch of time, thanks. :-)


Discussion / hints:
Issue is stale and will be closed in 14 days unless there is new activity
Marco...
I've found: https://github.com/go-git/go-git/pull/402 which hasn't yet been released (the last release was in June 2021: https://github.com/go-git/go-git/releases/tag/v5.4.2)
we can pin to specific commit 

Fix patch:
diff --git a/go.mod b/go.mod
index fb7aef0894d..60890bbfce9 100644
--- a/go.mod
+++ b/go.mod
@@ -32,7 +32,8 @@ require (
 	github.com/spf13/cobra v1.4.0
 	github.com/spf13/pflag v1.0.5
 	github.com/stretchr/testify v1.7.1
-	github.com/xanzy/ssh-agent v0.3.1 // indirect
 	golang.org/x/term v0.0.0-20210916214954-140adaaadfaf
 	gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
 )
+
+replace github.com/go-git/go-git/v5 => github.com/ZauberNerd/go-git/v5 v5.4.3-0.20220315170230-29ec1bc1e5db
diff --git a/go.sum b/go.sum
index ef40b259de7..f7421db0b81 100644
--- a/go.sum
+++ b/go.sum
@@ -168,6 +168,8 @@ github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:H
 github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
 github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
 github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
+github.com/ZauberNerd/go-git/v5 v5.4.3-0.20220315170230-29ec1bc1e5db h1:b0xyxkCQ0PQEH7gFQ8D+xa9lb+bur6RgVsRBodaqza4=
+github.com/ZauberNerd/go-git/v5 v5.4.3-0.20220315170230-29ec1bc1e5db/go.mod h1:U7oc8MDRtQhVD6StooNkBMVsh/Y4J/2Vl36Mo4IclvM=
 github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk=
 github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4=
 github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
@@ -515,13 +517,10 @@ github.com/go-critic/go-critic v0.4.1/go.mod h1:7/14rZGnZbY6E38VEGk2kVhoq6itzc1E
 github.com/go-critic/go-critic v0.4.3/go.mod h1:j4O3D4RoIwRqlZw5jJpx0BNfXWWbpcJoKu5cYSe4YmQ=
 github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4=
 github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E=
-github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
 github.com/go-git/go-billy/v5 v5.3.1 h1:CPiOUAzKtMRvolEKw+bG1PLRpT7D3LIs3/3ey4Aiu34=
 github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
-github.com/go-git/go-git-fixtures/v4 v4.2.1 h1:n9gGL1Ct/yIw+nfsfr8s4+sbhT+Ncu2SubfXjIWgci8=
-github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0=
-github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4=
-github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc=
+github.com/go-git/go-git-fixtures/v4 v4.3.1 h1:y5z6dd3qi8Hl+stezc8p3JxDkoTRqMAlKnXHuzrfjTQ=
+github.com/go-git/go-git-fixtures/v4 v4.3.1/go.mod h1:8LHG1a3SRW71ettAD/jW13h8c6AqjVSeL11RAdgaqpo=
 github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
@@ -1299,7 +1298,6 @@ github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT
 github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI=
 github.com/xanzy/go-gitlab v0.31.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug=
 github.com/xanzy/go-gitlab v0.32.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug=
-github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0=
 github.com/xanzy/ssh-agent v0.3.1 h1:AmzO1SSWxw73zxFZPRwaMN1MohDw8UyHnmuxyceTEGo=
 github.com/xanzy/ssh-agent v0.3.1/go.mod h1:QIE4lCeL7nkC25x+yA3LBIYfwCc1TFziCtG7cBAac6w=
 github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
@@ -1399,7 +1397,6 @@ golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnf
 golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
 golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
 golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
-golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
 golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
@@ -1417,7 +1414,6 @@ golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPh
 golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
 golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
 golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
-golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
 golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
 golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
 golang.org/x/crypto v0.0.0-20211202192323-5770296d904e h1:MUP6MR3rJ7Gk9LEia0LP2ytiH6MuCfs7qYz+47jGdD8=
@@ -1658,7 +1654,6 @@ golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7w
 golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=


Test patch: