diff --git a/pipeline/backend/local/clone.go b/pipeline/backend/local/clone.go index 8ec0bfcf1..5ad899548 100644 --- a/pipeline/backend/local/clone.go +++ b/pipeline/backend/local/clone.go @@ -84,8 +84,6 @@ func (e *local) execClone(ctx context.Context, step *types.Step, state *workflow return err } - env = append(env, "CI_WORKSPACE="+state.workspaceDir) - // Prepare command var cmd *exec.Cmd if rmCmd != "" { diff --git a/pipeline/backend/local/const.go b/pipeline/backend/local/const.go index 702d17b28..70594a762 100644 --- a/pipeline/backend/local/const.go +++ b/pipeline/backend/local/const.go @@ -27,6 +27,7 @@ var notAllowedEnvVarOverwrites = []string{ "CI_SCRIPT", "HOME", "SHELL", + "CI_WORKSPACE", } var ( diff --git a/pipeline/backend/local/local.go b/pipeline/backend/local/local.go index 070f1db28..37169f818 100644 --- a/pipeline/backend/local/local.go +++ b/pipeline/backend/local/local.go @@ -112,9 +112,10 @@ func (e *local) StartStep(ctx context.Context, step *types.Step, taskUUID string } } - // Set HOME + // Set HOME and CI_WORKSPACE env = append(env, "HOME="+state.homeDir) env = append(env, "USERPROFILE="+state.homeDir) + env = append(env, "CI_WORKSPACE="+state.workspaceDir) switch step.Type { case types.StepTypeClone: