-
Notifications
You must be signed in to change notification settings - Fork 59.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Windows default shell #1558
Conversation
Thanks for opening this pull request! A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines. |
@al-cheb Thanks so much for opening a PR! I'll get this triaged for review 🌟 |
(For information: I just updated this PR from |
This PR is stale because it has been open 7 days with no activity and will be automatically closed in 3 days. To keep this PR open, update the PR by adding a comment or pushing a commit. |
Thanks for your patience! Our small team is working our way through reviewing all of the amazing contributions ✨ |
A rendered preview of these changes is available here: https://docs-1558--al-chebwindows-defa.herokuapp.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell |
content/actions/reference/workflow-syntax-for-github-actions.md
Outdated
Show resolved
Hide resolved
Status update: Checking these changes with our support folks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
This PR is stale because it has been open 7 days with no activity and will be automatically closed in 3 days. To keep this PR open, update the PR by adding a comment or pushing a commit. |
@martin389, Thank you. |
This PR is stale because it has been open 7 days with no activity and will be automatically closed in 3 days. To keep this PR open, update the PR by adding a comment or pushing a commit. |
Status update: Following up with support folks ✨ |
@@ -646,7 +646,8 @@ You can override the default shell settings in the runner's operating system usi | |||
| All | `python` | Executes the python command. | `python {0}` | | |||
| Linux / macOS | `sh` | The fallback behavior for non-Windows platforms if no shell is provided and `bash` is not found in the path. | `sh -e {0}` | | |||
| Windows | `cmd` | {% data variables.product.prodname_dotcom %} appends the extension `.cmd` to your script name and substitutes for `{0}`. | `%ComSpec% /D /E:ON /V:OFF /S /C "CALL "{0}""`. | | |||
| Windows | `powershell` | This is the default shell used on Windows. The Desktop PowerShell. {% data variables.product.prodname_dotcom %} appends the extension `.ps1` to your script name. | `powershell -command ". '{0}'"`. | | |||
| Windows | `pwsh` | This is the default shell used on Windows. The PowerShell Core. {% data variables.product.prodname_dotcom %} appends the extension `.ps1` to your script name. | `pwsh -command ". '{0}'"`. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is absolutely correct for Hosted runners but I have small note about self-hosted:
If self-hosted Windows runner doesn't have PowerShell Core
installed, default shell falls back to PowerShell Desktop
.
Related code: https://github.com/actions/runner/blob/main/src/Runner.Worker/Handlers/ScriptHandler.cs#L87
@martin389, do you think it should be mentioned?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @maxim-lobanov, makes sense to me 👍 I'll add a note to mention this.
Thanks very much for contributing! Your pull request has been merged 🎉 You should see your changes appear on the site in approximately 24 hours. |
Thank you for this PR! Changes will be visible here once published: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell |
Why:
Windows default shell is incorrect.
Windows Server 2016:
Windows Server 2019:
What's being changed:
Set the default shell is
pwsh
for Windows.Check off the following:
A rendered preview of these changes is available here: https://docs-1558--al-chebwindows-defa.herokuapp.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell