[PR #949] [CLOSED] fix: copy git tracked files (#912) #1702

Closed
opened 2026-03-01 21:52:18 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/949
Author: @jsoref
Created: 1/2/2022
Status: Closed

Base: masterHead: issue-912


📝 Commits (1)

📊 Changes

1 file changed (+75 additions, -26 deletions)

View changed files

📝 pkg/container/docker_run.go (+75 -26)

📄 Description

So, this is almost certainly not the right fix for #912, but for git oriented projects it does something which would probably be good enough for me anyway. -- Note: I'm not a go dev, so the style here is probably very wrong, it's just an attempt at playing with things. I'm sure I could find the proper go-git function to ask "are you tracked", but I decided to start with the simpler "go ls-files" approach.

Before

% act
[What do I have/Introspection] 🚀  Start image=catthehacker/ubuntu:act-latest
[What do I have/Introspection]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false
[What do I have/Introspection]   🐳  docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[What do I have/Introspection]   🐳  docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[What do I have/Introspection]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir=
[What do I have/Introspection]   🐳  docker cp src=/Users/jsoref/code/nektos/ignored/. dst=/Users/jsoref/code/nektos/ignored
[What do I have/Introspection]   🐳  docker exec cmd=[mkdir -p /Users/jsoref/code/nektos/ignored] user= workdir=
[What do I have/Introspection] ⭐  Run checkout
[What do I have/Introspection]   ✅  Success - checkout
[What do I have/Introspection] ⭐  Run introspect
[What do I have/Introspection]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /Users/jsoref/code/nektos/ignored/workflow/1] user= workdir=
| total 4
| drwxr-xr-x 2 root root 4096 Jan  2 06:15 workflow
[What do I have/Introspection]   ✅  Success - introspect

After

% ../act/dist/local/act
[What do I have/Introspection] 🚀  Start image=catthehacker/ubuntu:act-latest
[What do I have/Introspection]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false
[What do I have/Introspection]   🐳  docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[What do I have/Introspection]   🐳  docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[What do I have/Introspection]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir=
[What do I have/Introspection]   🐳  docker cp src=/Users/jsoref/code/nektos/ignored/. dst=/Users/jsoref/code/nektos/ignored
[What do I have/Introspection]   🐳  docker exec cmd=[mkdir -p /Users/jsoref/code/nektos/ignored] user= workdir=
[What do I have/Introspection] ⭐  Run checkout
[What do I have/Introspection]   ✅  Success - checkout
[What do I have/Introspection] ⭐  Run introspect
[What do I have/Introspection]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1] user= workdir=
| total 0
| -rw-r--r-- 1 502 dialout 0 Jan  2 05:49 README.md
[What do I have/Introspection]   ✅  Success - introspect

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/nektos/act/pull/949 **Author:** [@jsoref](https://github.com/jsoref) **Created:** 1/2/2022 **Status:** ❌ Closed **Base:** `master` ← **Head:** `issue-912` --- ### 📝 Commits (1) - [`c8ccf20`](https://github.com/nektos/act/commit/c8ccf200987d5f3c87ecc0bbeaba37f298ed1d4b) fix: copy git tracked files (#912) ### 📊 Changes **1 file changed** (+75 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `pkg/container/docker_run.go` (+75 -26) </details> ### 📄 Description So, this is almost certainly not the right fix for #912, but for git oriented projects it does something which would probably be good enough for me anyway. -- Note: I'm not a go dev, so the style here is probably very wrong, it's just an attempt at playing with things. I'm sure I could find the proper go-git function to ask "are you tracked", but I decided to start with the simpler "go ls-files" approach. # Before ``` % act [What do I have/Introspection] 🚀 Start image=catthehacker/ubuntu:act-latest [What do I have/Introspection] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false [What do I have/Introspection] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [What do I have/Introspection] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [What do I have/Introspection] 🐳 docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir= [What do I have/Introspection] 🐳 docker cp src=/Users/jsoref/code/nektos/ignored/. dst=/Users/jsoref/code/nektos/ignored [What do I have/Introspection] 🐳 docker exec cmd=[mkdir -p /Users/jsoref/code/nektos/ignored] user= workdir= [What do I have/Introspection] ⭐ Run checkout [What do I have/Introspection] ✅ Success - checkout [What do I have/Introspection] ⭐ Run introspect [What do I have/Introspection] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /Users/jsoref/code/nektos/ignored/workflow/1] user= workdir= | total 4 | drwxr-xr-x 2 root root 4096 Jan 2 06:15 workflow [What do I have/Introspection] ✅ Success - introspect ``` # After ``` % ../act/dist/local/act [What do I have/Introspection] 🚀 Start image=catthehacker/ubuntu:act-latest [What do I have/Introspection] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false [What do I have/Introspection] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [What do I have/Introspection] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [What do I have/Introspection] 🐳 docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir= [What do I have/Introspection] 🐳 docker cp src=/Users/jsoref/code/nektos/ignored/. dst=/Users/jsoref/code/nektos/ignored [What do I have/Introspection] 🐳 docker exec cmd=[mkdir -p /Users/jsoref/code/nektos/ignored] user= workdir= [What do I have/Introspection] ⭐ Run checkout [What do I have/Introspection] ✅ Success - checkout [What do I have/Introspection] ⭐ Run introspect [What do I have/Introspection] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1] user= workdir= | total 0 | -rw-r--r-- 1 502 dialout 0 Jan 2 05:49 README.md [What do I have/Introspection] ✅ Success - introspect ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-01 21:52:18 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#1702
No description provided.