diff options
author | Earl Warren <contact@earl-warren.org> | 2024-11-20 09:59:34 +0100 |
---|---|---|
committer | Earl Warren <contact@earl-warren.org> | 2024-11-20 10:42:15 +0100 |
commit | 6095282089676f5f34b960bc7de04cbd35635d1f (patch) | |
tree | 34fdc6769afda6f35da9956e6639e78703df4bbd | |
parent | Merge pull request 'Support overwriting caches' (#60) from wip-artifactcache ... (diff) | |
download | forgejo-act-6095282089676f5f34b960bc7de04cbd35635d1f.tar.xz forgejo-act-6095282089676f5f34b960bc7de04cbd35635d1f.zip |
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.
-rw-r--r-- | pkg/runner/run_context.go | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/pkg/runner/run_context.go b/pkg/runner/run_context.go index 06679ca..8ecdb2b 100644 --- a/pkg/runner/run_context.go +++ b/pkg/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 |