diff --git a/pkg/model/workflow.go b/pkg/model/workflow.go index 8fe9354d093..252ad9ebacd 100644 --- a/pkg/model/workflow.go +++ b/pkg/model/workflow.go @@ -262,15 +262,15 @@ func (s *Step) ShellCommand() string { case "", "bash": shellCommand = "bash --login --noprofile --norc -e -o pipefail {0}" case "pwsh": - shellCommand = "pwsh -login -command . '{0}'" + shellCommand = "pwsh -command . '{0}'" + case "powershell": + shellCommand = "powershell -command . '{0}'" case "python": shellCommand = "python {0}" case "sh": shellCommand = "sh -l -e -c {0}" case "cmd": shellCommand = "%ComSpec% /D /E:ON /V:OFF /S /C \"CALL \"{0}\"\"" - case "powershell": - shellCommand = "powershell -command . '{0}'" default: shellCommand = s.Shell } @@ -313,12 +313,12 @@ func (s *Step) Type() StepType { } func (s *Step) Validate() error { - if s.Type() != StepTypeRun { - return fmt.Errorf("(StepID: %s): Unexpected value 'uses'", s.String()) - } else if s.Shell == "" { - return fmt.Errorf("(StepID: %s): Required property is missing: 'shell'", s.String()) - } - return nil + if s.Type() != StepTypeRun { + return fmt.Errorf("(StepID: %s): Unexpected value 'uses'", s.String()) + } else if s.Shell == "" { + return fmt.Errorf("(StepID: %s): Required property is missing: 'shell'", s.String()) + } + return nil } // ReadWorkflow returns a list of jobs for a given workflow file reader