question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Default shell, and option to select a different shell

See original GitHub issue

It would be very useful, in order to convert easily a “normal” command if a shell parameter was supported, to change the shell executing the command. See: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell

Also, from what I understand, on windows runners, the shell used is cmd, since the only way I could find to set a comment was using rem. The one used by default from normal actions is bash, I think it would be great if the action default was the same.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
drdanzcommented, Nov 19, 2020

Sorry, I just double checked, I was wrong, the default on windows is powershell, not bash.

Here is the simplest example I could imagine

    - name: Ok
      if: runner.os == 'Windows'
      run: Get-ComputerInfo

    - name: Not ok
      if: runner.os == 'Windows'
      uses: nick-invision/retry@v2
      with:
        timeout_minutes: 10
        retry_wait_seconds: 1
        max_attempts: 3
        command: Get-ComputerInfo
0reactions
nick-invisioncommented, Jan 4, 2021

Thanks to the contribution of @isaacrlevin, an alternate shell can now be specified with this action. Example:

uses: nick-invision/retry@v2
with:
  timeout_minutes: 10
  max_attempts: 3
  # if shell omitted, defaults to powershell on windows, bash otherwise.  Supported shells are bash, python, pwsh, sh, cmd, and powershell
  shell: pwsh
  command: dir
Read more comments on GitHub >

github_iconTop Results From Across the Web

Change my default shell in Linux using chsh - nixCraft
First, find out the available shells on your Linux box, run cat /etc/shells · Type chsh and press Enter key · You need...
Read more >
3 Ways to Change a Users Default Shell in Linux - Tecmint
In this article, we will describe 3 different ways to change a users default shell in Linux using some commandline tools such as...
Read more >
How to Change Shell in Linux
This quick tutorial shows how to check the running shell, available shell in the system and how to change the default shell in...
Read more >
How To Change Default Shell In Linux - GeeksforGeeks
In most Linux systems, the default shell is bash but we can change that to any other shell-like zsh, fish, sh, and any...
Read more >
How to Change your Shell
Answer: The chsh command changes the login shell of your username. When altering a login shell, the chsh command displays the current login...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found