Skip to content
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

Add zsh shell #264

Closed
1 of 5 tasks
phil-blain opened this issue Jan 13, 2020 · 17 comments
Closed
1 of 5 tasks

Add zsh shell #264

phil-blain opened this issue Jan 13, 2020 · 17 comments

Comments

@phil-blain
Copy link

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

  • 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:

steps:
  - name: Display the path
    run: echo $PATH
    shell: zsh

Are you willing to submit a PR?

How would I do that ?....

@al-cheb
Copy link
Contributor

al-cheb commented Jan 14, 2020

Hello, @phil-blain

As for now you can follow this approach: You can set the shell value to a template string using command […options] {0} [..more_options] : Custom shell

Example output:

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

image

@github-actions
Copy link
Contributor

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

@maxim-lobanov
Copy link
Contributor

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

@michaeltryby
Copy link

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

@maxim-lobanov
Copy link
Contributor

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

@michaeltryby
Copy link

michaeltryby commented Aug 20, 2020

@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.

@ljharb
Copy link

ljharb commented Feb 15, 2021

@maxim-lobanov i really don't understand why this is closed. Nobody's asking to change the default, but zsh should still be a first-class supported option.

@ssbarnea
Copy link

Preinstalling zsh should be done on all platforms because it is a very common shell and many repositories do have shell support testing code. While is unlikely that someone would want to run jobs with zsh shell, the is a real chance they would have few tests around what happens with zsh (completions being one of them).

Also zsh is small, so it should not concern increasing images too much.

@ki11roy
Copy link

ki11roy commented Nov 11, 2021

Why this one is closed? The shell is still missing on ubuntu-latest, for example too.

@miketimofeev
Copy link
Contributor

@ki11roy installing zsh takes about 20 seconds in runtime so it shouldn't be the issue.

@ljharb
Copy link

ljharb commented Nov 11, 2021

@miketimofeev the time isn’t the issue; it’s knowing which install command to use, and having to conditionally run it when testing on a matrix of shells.

@ki11roy
Copy link

ki11roy commented Nov 11, 2021

Example use case for zsh on ubuntu-latest (substitution)

name: RemoveMe 
on:
  workflow_dispatch:
jobs:
  jobName:
    name: Deploy
    runs-on: ubuntu-latest
    steps:
      - name: Install zsh
        run: sudo apt-get update; sudo apt-get install zsh
      - name: Print outputs branch name
        id: vars_branch
        run: echo "::set-output name=branch::${${GITHUB_BRANCH#refs/heads/}//\//-}"
        env:
          GITHUB_BRANCH: "test/1.2.3"
        shell: zsh {0}
      - name: Print branch name
        id: print
        run: echo "${{steps.vars_branch.outputs.branch}}"

@nnmrts
Copy link

nnmrts commented Nov 20, 2021

Can this issue please be reopened? There should be better supprt for zsh. In my opinion it should even be the default for all new workflows running on macos-latest and macos-11 but that's a different story...

@sensuikan1973
Copy link

sensuikan1973 commented Nov 23, 2021

@maxim-lobanov
This issue shouldn't be closed.
I don't arguing that the default shell on GitHub Actions should be zsh, but that zsh should be supported as an option.

It's because from Catalina, default shell on Mac is zsh. (See: https://support.apple.com/en-us/HT208050)
Although there is a workaround(#264 (comment)), but it is claimed to be invalid by GitHub when I see the workflow yaml on GitHub. It does work, but this situation should be fixed.
image

This is not a high priority, but should be reopened.

@maxim-lobanov
Copy link
Contributor

@sensuikan1973 ,
The initial issue was scoped about adding zsh to macOS system only and actually it is available on macOS images. It is why this issue is closed.

If you request adding zsh to Ubuntu images, feel free to log a separate feature request for Ubuntu OS.
As for the UI issue reported by you, could you please log separate issue for that in https://github.com/actions/runner repo. In this repository, we maintain only pre-installed software on Hosted images

@nathanielford nathanielford mentioned this issue Jan 9, 2022
9 tasks
simonw added a commit to simonw/scrape-hacker-news-by-domain that referenced this issue Dec 2, 2022
Turns out GitHub Actions doesn't have zsh installed

actions/runner-images#264
@ross-paypay
Copy link

Can we please re-open this issue? This is still relevant in 2023.

@roddi
Copy link

roddi commented May 23, 2024

Can we please re-open this issue? This is still relevant in 2024.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests