From c42fa5f41282ce32807bb9455651948d588df319 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 20 Nov 2024 08:59:34 +0000 Subject: [PATCH] fix: [FORGEJO] do not share the act-toolcache volume In the context of Forgejo the act-toolcache must not be mounted otherwise independent workflows will race against each other when writing to it. For instance if a setup-go action is run at the same time as another, there is a probability that they both write the same file at the same time, which could lead to a truncated or invalid content. --- act/runner/run_context.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/act/runner/run_context.go b/act/runner/run_context.go index 06679cae..8ecdb2ba 100644 --- a/act/runner/run_context.go +++ b/act/runner/run_context.go @@ -140,8 +140,7 @@ func (rc *RunContext) GetBindsAndMounts() ([]string, map[string]string) { ext := container.LinuxContainerEnvironmentExtensions{} mounts := map[string]string{ - "act-toolcache": "/opt/hostedtoolcache", - name + "-env": ext.GetActPath(), + name + "-env": ext.GetActPath(), } if job := rc.Run.Job(); job != nil { @@ -172,9 +171,7 @@ func (rc *RunContext) GetBindsAndMounts() ([]string, map[string]string) { mounts[name] = ext.ToContainerPath(rc.Config.Workdir) } - // For Gitea // add some default binds and mounts to ValidVolumes - rc.Config.ValidVolumes = append(rc.Config.ValidVolumes, "act-toolcache") rc.Config.ValidVolumes = append(rc.Config.ValidVolumes, name) rc.Config.ValidVolumes = append(rc.Config.ValidVolumes, name+"-env") // TODO: add a new configuration to control whether the docker daemon can be mounted