From 515b7270a565a638a92d2b0a20f1c89acfc71c19 Mon Sep 17 00:00:00 2001 From: Robert-Furth Date: Mon, 23 Aug 2021 20:25:01 +0000 Subject: [PATCH] Put scripts in /tmp instead of the working directory --- pkg/runner/step_context.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/runner/step_context.go b/pkg/runner/step_context.go index baa88a56e6a..a423c8eacff 100644 --- a/pkg/runner/step_context.go +++ b/pkg/runner/step_context.go @@ -227,7 +227,7 @@ func (sc *StepContext) setupShellCommand() common.Executor { run = runPrepend + "\n" + run + "\n" + runAppend log.Debugf("Wrote command '%s' to '%s'", run, scriptName) - scriptPath := fmt.Sprintf("%s/%s", rc.Config.ContainerWorkdir(), scriptName) + scriptPath := fmt.Sprintf("/tmp/%s", scriptName) if step.Shell == "" { step.Shell = rc.Run.Job().Defaults.Run.Shell @@ -252,7 +252,7 @@ func (sc *StepContext) setupShellCommand() common.Executor { sc.Cmd = finalCMD - return rc.JobContainer.Copy(rc.Config.ContainerWorkdir(), &container.FileEntry{ + return rc.JobContainer.Copy("/tmp/", &container.FileEntry{ Name: scriptName, Mode: 0755, Body: script.String(),