From b8ac81e9ddaa5839062e01192666dcfd033d1b8c Mon Sep 17 00:00:00 2001 From: Vladimir Romashchenko <52473614+eaglesemanation@users.noreply.github.com> Date: Fri, 26 Nov 2021 00:18:31 -0500 Subject: [PATCH] feat: SELinux lables for --bind (#906) --- act/runner/run_context.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/act/runner/run_context.go b/act/runner/run_context.go index b7e7a171..40a65f22 100755 --- a/act/runner/run_context.go +++ b/act/runner/run_context.go @@ -17,6 +17,8 @@ import ( "github.com/mitchellh/go-homedir" log "github.com/sirupsen/logrus" + selinux "github.com/opencontainers/selinux/go-selinux" + "github.com/nektos/act/pkg/common" "github.com/nektos/act/pkg/container" "github.com/nektos/act/pkg/model" @@ -90,6 +92,9 @@ func (rc *RunContext) GetBindsAndMounts() ([]string, map[string]string) { if runtime.GOOS == "darwin" { bindModifiers = ":delegated" } + if selinux.GetEnabled() { + bindModifiers = ":z" + } binds = append(binds, fmt.Sprintf("%s:%s%s", rc.Config.Workdir, rc.Config.ContainerWorkdir(), bindModifiers)) } else { mounts[name] = rc.Config.ContainerWorkdir()