Update Shell Tasks to match ScriptHandlerHelpers (#575)
* Update Shell Tasks to match ScriptHandlerHelpers Code: https://github.com/actions/runner/blob/main/src/Runner.Worker/Handlers/ScriptHandlerHelpers.cs Docs: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell Fixes #467 * 🩹 Remove old ps1 handler * ♻️ gocritix fix * 🐛 Powershell command must be a single entry to docker API Fixes #467 * Remove Act Temp * Remove additional Act Directories * remove hard-coded workdir Co-authored-by: Casey Lee <cplee@nektos.com>
This commit is contained in:
@@ -257,11 +257,12 @@ func (s *Step) GetEnv() map[string]string {
|
||||
func (s *Step) ShellCommand() string {
|
||||
shellCommand := ""
|
||||
|
||||
//Reference: https://github.com/actions/runner/blob/8109c962f09d9acc473d92c595ff43afceddb347/src/Runner.Worker/Handlers/ScriptHandlerHelpers.cs#L9-L17
|
||||
switch s.Shell {
|
||||
case "", "bash":
|
||||
shellCommand = "bash --login --norc -e {0}"
|
||||
shellCommand = "bash --login --noprofile --norc -e -o pipefail {0}"
|
||||
case "pwsh":
|
||||
shellCommand = "pwsh -login -command \"& '{0}'\""
|
||||
shellCommand = "pwsh -login -command . '{0}'"
|
||||
case "python":
|
||||
shellCommand = "python {0}"
|
||||
case "sh":
|
||||
@@ -269,7 +270,7 @@ func (s *Step) ShellCommand() string {
|
||||
case "cmd":
|
||||
shellCommand = "%ComSpec% /D /E:ON /V:OFF /S /C \"CALL \"{0}\"\""
|
||||
case "powershell":
|
||||
shellCommand = "powershell -command \"& '{0}'\""
|
||||
shellCommand = "powershell -command . '{0}'"
|
||||
default:
|
||||
shellCommand = s.Shell
|
||||
}
|
||||
|
Reference in New Issue
Block a user