forked from Ivasoft/github-actions
Patch act to not bind the workdir as we do it using --container-options
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
18
patches/001-workdir-bind.patch
Normal file
18
patches/001-workdir-bind.patch
Normal 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)
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user