From 95d91bb4f0d3348f4842a562377f83b52fb02be7 Mon Sep 17 00:00:00 2001 From: Prakash Kumar Date: Fri, 20 Jun 2025 17:52:49 +0530 Subject: [PATCH] =?UTF-8?q?if=20step.ExecutorType=20=3D=3D=20helper.SHELL,?= =?UTF-8?q?=20then=20reserve=20WORKINGDIR,=20skip=20copying=20script=20out?= =?UTF-8?q?put=20in=20this=20otherwise=20it=20creates=20classic=20recursiv?= =?UTF-8?q?e=20self-copy=20situation=20=E2=80=94=20trying=20to=20copy=20a?= =?UTF-8?q?=20directory=20into=20a=20subdirectory=20of=20itself?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ci-runner/executor/StageExecutor.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ci-runner/executor/StageExecutor.go b/ci-runner/executor/StageExecutor.go index 629119f9b..cff7ff121 100644 --- a/ci-runner/executor/StageExecutor.go +++ b/ci-runner/executor/StageExecutor.go @@ -30,6 +30,7 @@ import ( "os" "path/filepath" "runtime/debug" + "strings" ) type StageExecutorImpl struct { @@ -225,6 +226,10 @@ func (impl *StageExecutorImpl) RunCiCdStep(stepType helper.StepType, ciCdRequest stepOutputVarsFinal = stageOutputVars if len(step.ArtifactPaths) > 0 { for _, path := range step.ArtifactPaths { + if strings.HasPrefix(path, util.WORKINGDIR) { + log.Printf("skipping copying files to '/devtroncd' path as it's reserved") + continue + } err = copylib.Copy(path, filepath.Join(util.TmpArtifactLocation, step.Name, path)) if err != nil { if _, ok := err.(*os.PathError); ok {