Virtual-environments: Add zsh shell

Created on 13 Jan 2020  路  6Comments  路  Source: actions/virtual-environments

Tool information

  • Tool name: zsh
  • Add or update? add
  • Desired version: the one that is already at /bin/zsh
  • Approximate size: probably 0 since it's already installed
  • If this is an add request:

Area for Triage:

Scripting and command line

Question, Bug, or Feature?:

Feature

Virtual environments affected

  • [x] macOS 10.15
  • [ ] Ubuntu 16.04 LTS
  • [ ] Ubuntu 18.04 LTS
  • [ ] Windows Server 2016 R2
  • [ ] Windows Server 2019

Can this tool be installed during the build?

It's already installed, so jobs can do zsh -c 'whatever' or use a custom shell command but it would be easier to be able to write:
~~~yml
steps:

  • name: Display the path
    run: echo $PATH
    shell: zsh
    ~~~

Are you willing to submit a PR?

How would I do that ?....

Scripting and command line enhancement no-issue-activity

Most helpful comment

@maxim-lobanov Actually its a little known fact that support for bash on Mac OS is not all that good. The default version of bash is quite old and scripts written for newer bash on Linux frequently don't run.

The best solution would be to support both.

All 6 comments

Hello, @phil-blain

As for now you can follow this approach: You can set the shell value to a template string usingcommand [鈥ptions] {0} [..more_options] : Custom shell

Example output:

    - name: Display the path
      run: |
        echo $ZSH_NAME $ZSH_VERSION
      shell: zsh {0}

image

This issue has not had any activity in 30 days, if you still require assistance please remove the no-issue-activity label

Closing the issue since solution was provided above. Feel free to reopen if needs

Since zsh is the default shell on Mac OS, it's surprising that it's not fully supported in Actions.

@michaeltryby , bash and zsh shell are not equal. And switching to zsh can affect a lot of customers and break existing scripts

@maxim-lobanov Actually its a little known fact that support for bash on Mac OS is not all that good. The default version of bash is quite old and scripts written for newer bash on Linux frequently don't run.

The best solution would be to support both.

Was this page helpful?
0 / 5 - 0 ratings