Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pkg/tasks/run_shell/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ func (t *Task) Execute(ctx context.Context) error {
//nolint:gosec // ignore
command := exec.CommandContext(ctx, t.config.Shell, t.config.ShellArgs...)

// Inherit parent environment so spawned shells have HOME/PATH/USER.
// Without this, exec.Cmd.Env is nil and the child inherits nothing;
// user-supplied envVars below still take precedence via append order.
command.Env = append(command.Env, os.Environ()...)

stdin, err := command.StdinPipe()
if err != nil {
cmdLogger.Errorf("failed getting stdin pipe")
Expand Down