Patch act to not bind the workdir as we do it using --container-options
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2023-07-31 12:21:39 +02:00
parent c8c002ab01
commit 7bae512b01
3 changed files with 21 additions and 5 deletions

View File

@@ -7,6 +7,7 @@ steps:
commands:
- git clone -b v0.2.48 https://github.com/nektos/act.git && cd act
- export ACT_VERSION=$(git describe --tags --dirty --always | sed -e 's/^v//')
- patch ../patches/001-workdir-bind.patch
- mkdir bin
- GOOS=linux GOARCH=amd64 go build -ldflags "-X main.version=$ACT_VERSION" -o bin/act main.go

View File

@@ -0,0 +1,18 @@
--- "a/pkg/runner/run_context.go"
+++ "b/pkg/runner/run_context.go"
@@ -142,14 +142,7 @@ func (rc *RunContext) GetBindsAndMounts() ([]string, map[string]string) {
}
if rc.Config.BindWorkdir {
- bindModifiers := ""
- if runtime.GOOS == "darwin" {
- bindModifiers = ":delegated"
- }
- if selinux.GetEnabled() {
- bindModifiers = ":z"
- }
- binds = append(binds, fmt.Sprintf("%s:%s%s", rc.Config.Workdir, ext.ToContainerPath(rc.Config.Workdir), bindModifiers))
+ // Bind done using --container-options command-line option
} else {
mounts[name] = ext.ToContainerPath(rc.Config.Workdir)
}

View File

@@ -71,6 +71,7 @@ func (p Plugin) Exec() error {
secretFile,
"--env-file",
envFile,
"-b",
"--detect-event",
}
@@ -106,11 +107,7 @@ func (p Plugin) Exec() error {
bindModifiers = ":z"
}
cmdArgs = append(cmdArgs, "--container-options", fmt.Sprintf("--volume=%s:%s%s", hostWorkDirPath, guestWorkDirPath, bindModifiers))
}// else {
cmdArgs = append(cmdArgs, "-b")
//}
}
cmd := exec.Command("act", cmdArgs...)
cmd.Stdout = os.Stdout