diff --git a/.drone.yml b/.drone.yml index fedc5d0..e056aef 100644 --- a/.drone.yml +++ b/.drone.yml @@ -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 diff --git a/patches/001-workdir-bind.patch b/patches/001-workdir-bind.patch new file mode 100644 index 0000000..28c0a86 --- /dev/null +++ b/patches/001-workdir-bind.patch @@ -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) + } diff --git a/plugin.go b/plugin.go index 8be37d5..606fe21 100644 --- a/plugin.go +++ b/plugin.go @@ -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