You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a custom shell but the first word in my shell is powershell. The function linked above is parsing out that first word. That function is used here:
Describe the bug
When using a custom shell command, the runner added lines to my script even though the docs say that it wasn't supposed to: https://github.com/actions/runner/blame/feafd3e1d79a627b18e63705d1021165d978ba46/docs/adrs/0277-run-action-shell-options.md#L84
I think that it's due to this function:
runner/src/Runner.Worker/Handlers/ScriptHandlerHelpers.cs
Line 66 in c18c874
I have a custom shell but the first word in my shell is
powershell
. The function linked above is parsing out that first word. That function is used here:runner/src/Runner.Worker/Handlers/ScriptHandler.cs
Line 109 in c18c874
Then a function to "fixup" scripts is called:
runner/src/Runner.Worker/Handlers/ScriptHandler.cs
Line 240 in c18c874
And that function only looks at the first word of the shell to determine if the script needs a fixup. The fixup is here:
runner/src/Runner.Worker/Handlers/ScriptHandlerHelpers.cs
Line 56 in c18c874
And that fixup will add the line to the script at the top and the bottom, even for a custom script, so long as it starts with
powershell
orpwsh
.This is different from what the documentation says. Either the code is wrong or the docs are wrong.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expected no extra lines to be added
OS of the machine running the runner? Windows
Job Log Output
Notice that I have a custom shell and that custom shell prints out the contents of the script. Notice that the script has lines added to it.
https://github.com/eyal0/universal-ci-shell/runs/1612490299?check_suite_focus=true
You can see that the shell was custom yet the lines got added anyway.
I found this while working on msys2/setup-msys2#104
The text was updated successfully, but these errors were encountered: