Fix CI_WORKSPACE in local backend (#2627)

closes https://github.com/woodpecker-ci/woodpecker/issues/2610
This commit is contained in:
qwerty287 2023-10-23 12:54:10 +02:00 committed by GitHub
parent 7cbbedbc06
commit efbde332a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -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 != "" {

View file

@ -27,6 +27,7 @@ var notAllowedEnvVarOverwrites = []string{
"CI_SCRIPT",
"HOME",
"SHELL",
"CI_WORKSPACE",
}
var (

View file

@ -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: