Skip to content

Commit efbde33

Browse files
authored
Fix CI_WORKSPACE in local backend (#2627)
closes #2610
1 parent 7cbbedb commit efbde33

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

pipeline/backend/local/clone.go

-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ func (e *local) execClone(ctx context.Context, step *types.Step, state *workflow
8484
return err
8585
}
8686

87-
env = append(env, "CI_WORKSPACE="+state.workspaceDir)
88-
8987
// Prepare command
9088
var cmd *exec.Cmd
9189
if rmCmd != "" {

pipeline/backend/local/const.go

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ var notAllowedEnvVarOverwrites = []string{
2727
"CI_SCRIPT",
2828
"HOME",
2929
"SHELL",
30+
"CI_WORKSPACE",
3031
}
3132

3233
var (

pipeline/backend/local/local.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,10 @@ func (e *local) StartStep(ctx context.Context, step *types.Step, taskUUID string
112112
}
113113
}
114114

115-
// Set HOME
115+
// Set HOME and CI_WORKSPACE
116116
env = append(env, "HOME="+state.homeDir)
117117
env = append(env, "USERPROFILE="+state.homeDir)
118+
env = append(env, "CI_WORKSPACE="+state.workspaceDir)
118119

119120
switch step.Type {
120121
case types.StepTypeClone:

0 commit comments

Comments
 (0)